From d9c5d2e6ec26d4d3cce5bd0d84ff031f5a3c6435 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:48 +0200 Subject: [PATCH 001/825] Revert "[nrf fromlist] logging: frontend_stmesp: Avoid unaligned word access" This reverts commit 5bb7bb0af17cbdbd13c06ed5ea1268ec9b9358fc. --- .../logging/frontends/log_frontend_stmesp.c | 70 ++----------------- 1 file changed, 6 insertions(+), 64 deletions(-) diff --git a/subsys/logging/frontends/log_frontend_stmesp.c b/subsys/logging/frontends/log_frontend_stmesp.c index 4042fac853c..e1d3a7a7e8b 100644 --- a/subsys/logging/frontends/log_frontend_stmesp.c +++ b/subsys/logging/frontends/log_frontend_stmesp.c @@ -33,10 +33,6 @@ BUILD_ASSERT(sizeof(void *) == sizeof(uint32_t)); stmesp_data8(reg, data, timestamp, marked, \ IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP_GUARANTEED_ACCESS)) -#define STM_D16(reg, data, timestamp, marked) \ - stmesp_data16(reg, data, timestamp, marked, \ - IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP_GUARANTEED_ACCESS)) - #define STM_D32(reg, data, timestamp, marked) \ stmesp_data32(reg, data, timestamp, marked, \ IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP_GUARANTEED_ACCESS)) @@ -215,72 +211,18 @@ static int early_package_cb(const void *buf, size_t len, void *ctx) static inline void write_data(const void *data, size_t len, STMESP_Type *const stm_esp) { - const uint8_t *p8 = data; - const uint32_t *p32; - uint32_t unaligned; - - if (!len) { - return; - } + uint32_t *p32 = (uint32_t *)data; - /* Start by writing using D8 or D16 until pointer is word aligned. */ - unaligned = (uintptr_t)data & 0x00000003UL; - if (unaligned != 0) { - unaligned = 4 - unaligned; - unaligned = MIN(len, unaligned); - - len -= unaligned; - - switch (unaligned) { - case 3: - STM_D8(stm_esp, *p8++, false, false); - STM_D16(stm_esp, *(uint16_t *)p8, false, false); - p8 += sizeof(uint16_t); - break; - case 2: - if (len) { - STM_D16(stm_esp, *(uint16_t *)p8, false, false); - p8 += sizeof(uint16_t); - } else { - /* If len 0 then it means that even though 2 bytes are - * to be copied we can have address which is not aligned - * to 2 bytes. - */ - STM_D8(stm_esp, *p8++, false, false); - STM_D8(stm_esp, *p8++, false, false); - } - break; - default: - /* 1 byte to align. */ - STM_D8(stm_esp, *p8++, false, false); - } - } - - p32 = (const uint32_t *)p8; - - /* Use D32 to write as much data as possible. */ while (len >= sizeof(uint32_t)) { STM_D32(stm_esp, *p32++, false, false); len -= sizeof(uint32_t); } - /* Write tail using D16 or D8. Address is word aligned at that point. */ - if (len) { - p8 = (const uint8_t *)p32; - switch (len) { - case 2: - STM_D16(stm_esp, *(uint16_t *)p8, false, false); - p8 += sizeof(uint16_t); - break; - case 3: - STM_D16(stm_esp, *(uint16_t *)p8, false, false); - p8 += sizeof(uint16_t); - /* fallthrough */ - default: - /* 1 byte to align. */ - STM_D8(stm_esp, *p8++, false, false); - break; - } + uint8_t *p8 = (uint8_t *)p32; + + while (len > 0) { + STM_D8(stm_esp, *p8++, false, false); + len--; } } From c58e4f58b1129166a6651bfb572750392f2ad615 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 002/825] Revert "[nrf fromlist] logging: frontends: stmesp: Run clang-format" This reverts commit 83f64ee48eb1af655eb7dd4c729837d3e94b36a1. --- .../logging/frontends/log_frontend_stmesp.c | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/subsys/logging/frontends/log_frontend_stmesp.c b/subsys/logging/frontends/log_frontend_stmesp.c index e1d3a7a7e8b..389f0f72aeb 100644 --- a/subsys/logging/frontends/log_frontend_stmesp.c +++ b/subsys/logging/frontends/log_frontend_stmesp.c @@ -26,15 +26,15 @@ BUILD_ASSERT(sizeof(void *) == sizeof(uint32_t)); #define STMESP_FLUSH_WORD 0xaabbccdd -#define STM_FLAG(reg) \ +#define STM_FLAG(reg) \ stmesp_flag(reg, 1, false, IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP_GUARANTEED_ACCESS)) -#define STM_D8(reg, data, timestamp, marked) \ - stmesp_data8(reg, data, timestamp, marked, \ +#define STM_D8(reg, data, timestamp, marked) \ + stmesp_data8(reg, data, timestamp, marked, \ IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP_GUARANTEED_ACCESS)) -#define STM_D32(reg, data, timestamp, marked) \ - stmesp_data32(reg, data, timestamp, marked, \ +#define STM_D32(reg, data, timestamp, marked) \ + stmesp_data32(reg, data, timestamp, marked, \ IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP_GUARANTEED_ACCESS)) /* Buffer for storing frontend data before STM/ETR is ready for usage. @@ -95,7 +95,7 @@ union stm_log_dict_hdr { /* Dictionary header initializer. */ #define DICT_HDR_INITIALIZER(_level, _source_id, _data_len) \ { \ - .hdr = {.ver = CONFIG_LOG_FRONTEND_STMESP_DICT_VER, \ + .hdr = {.ver = CONFIG_LOG_FRONTEND_STMESP_DICT_VER, \ .type = STM_MSG_TYPE_LOG_DICT, \ .level = _level, \ .data_len = _data_len, \ @@ -281,8 +281,8 @@ void log_frontend_msg(const void *source, const struct log_msg_desc desc, uint8_ size_t sname_len; int package_len; int total_len; - static const uint32_t flags = - CBPRINTF_PACKAGE_CONVERT_RW_STR | CBPRINTF_PACKAGE_CONVERT_RO_STR; + static const uint32_t flags = CBPRINTF_PACKAGE_CONVERT_RW_STR | + CBPRINTF_PACKAGE_CONVERT_RO_STR; sname = log_source_name_get(0, get_source_id(source)); if (sname) { @@ -293,8 +293,8 @@ void log_frontend_msg(const void *source, const struct log_msg_desc desc, uint8_ } total_len = desc.data_len + sname_len /* null terminator */; - package_len = cbprintf_package_convert(package, desc.package_len, NULL, NULL, flags, strl, - ARRAY_SIZE(strl)); + package_len = cbprintf_package_convert(package, desc.package_len, NULL, NULL, flags, + strl, ARRAY_SIZE(strl)); hdr.log.total_len = total_len + package_len; hdr.log.package_len = package_len; @@ -308,8 +308,8 @@ void log_frontend_msg(const void *source, const struct log_msg_desc desc, uint8_ } STM_D32(stm_esp, hdr.raw, use_timestamp, true); - (void)cbprintf_package_convert(package, desc.package_len, package_cb, stm_esp, - flags, strl, ARRAY_SIZE(strl)); + (void)cbprintf_package_convert(package, desc.package_len, + package_cb, stm_esp, flags, strl, ARRAY_SIZE(strl)); write_data(sname, sname_len, stm_esp); if (data) { write_data(data, desc.data_len, stm_esp); @@ -327,8 +327,8 @@ void log_frontend_msg(const void *source, const struct log_msg_desc desc, uint8_ } early_buf_put_data((const uint8_t *)&hdr, sizeof(hdr)); - (void)cbprintf_package_convert(package, desc.package_len, early_package_cb, NULL, - flags, strl, ARRAY_SIZE(strl)); + (void)cbprintf_package_convert(package, desc.package_len, early_package_cb, + NULL, flags, strl, ARRAY_SIZE(strl)); early_buf_put_data(sname, sname_len); if (data) { early_buf_put_data(data, desc.data_len); @@ -357,8 +357,8 @@ void log_frontend_msg(const void *source, const struct log_msg_desc desc, uint8_ } STM_D32(stm_esp, dict_desc.raw, true, true); - (void)cbprintf_package_convert(package, desc.package_len, package_cb, stm_esp, - flags, NULL, 0); + (void)cbprintf_package_convert(package, desc.package_len, package_cb, + stm_esp, flags, NULL, 0); if (data) { package_cb(data, desc.data_len, stm_esp); } @@ -370,8 +370,8 @@ void log_frontend_msg(const void *source, const struct log_msg_desc desc, uint8_ key = k_spin_lock(&lock); len_loc = early_buf_len_loc(); early_package_cb(&dict_desc.raw, sizeof(dict_desc.raw), NULL); - (void)cbprintf_package_convert(package, desc.package_len, early_package_cb, NULL, - flags, NULL, 0); + (void)cbprintf_package_convert(package, desc.package_len, early_package_cb, + NULL, flags, NULL, 0); if (data) { early_package_cb(data, desc.data_len, NULL); } @@ -383,8 +383,8 @@ void log_frontend_msg(const void *source, const struct log_msg_desc desc, uint8_ /* Common function for optimized message (log with 0-2 arguments) which is used in * case when STMESP is not yet ready. */ -static inline uint32_t *early_msg_start(uint32_t level, const void *source, uint32_t package_hdr, - const char *fmt) +static inline uint32_t *early_msg_start(uint32_t level, const void *source, + uint32_t package_hdr, const char *fmt) { union stm_log_dict_hdr dict_desc = DICT_HDR_INITIALIZER(level, get_source_id(source), 0); uint32_t fmt32 = (uint32_t)fmt; @@ -398,8 +398,8 @@ static inline uint32_t *early_msg_start(uint32_t level, const void *source, uint } /* Common function for optimized message (log with 0-2 arguments) which writes to STMESP */ -static inline void msg_start(STMESP_Type *stm_esp, uint32_t level, const void *source, - uint32_t package_hdr, const char *fmt) +static inline void msg_start(STMESP_Type *stm_esp, uint32_t level, + const void *source, uint32_t package_hdr, const char *fmt) { union stm_log_dict_hdr dict_desc = DICT_HDR_INITIALIZER(level, get_source_id(source), 0); From ccc212329390b5c8de82551e382bb42776abbac7 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 003/825] Revert "[nrf fromlist] logging: frontend: stmesp_demux: Improve robustness" This reverts commit 641dfdcca61746b98bdb2c70e3fc7aad7921abac. --- subsys/logging/frontends/Kconfig | 6 ---- .../frontends/log_frontend_stmesp_demux.c | 35 +------------------ 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/subsys/logging/frontends/Kconfig b/subsys/logging/frontends/Kconfig index 89f03ea2d69..e984532d6f2 100644 --- a/subsys/logging/frontends/Kconfig +++ b/subsys/logging/frontends/Kconfig @@ -95,12 +95,6 @@ config LOG_FRONTEND_STMESP_DEMUX_BUFFER_SIZE config LOG_FRONTEND_STMESP_DEMUX_MAX_UTILIZATION bool "Track maximum utilization" -config LOG_FRONTEND_STMESP_DEMUX_GC_TIMEOUT - int "Message timeout (in milliseconds)" - default 100 - help - If log message is not completed within that time frame it is discarded. - endif # LOG_FRONTEND_STMESP_DEMUX config LOG_FRONTEND_STMESP_FLUSH_PORT_ID diff --git a/subsys/logging/frontends/log_frontend_stmesp_demux.c b/subsys/logging/frontends/log_frontend_stmesp_demux.c index a3c052eab25..ed09f89ec8e 100644 --- a/subsys/logging/frontends/log_frontend_stmesp_demux.c +++ b/subsys/logging/frontends/log_frontend_stmesp_demux.c @@ -25,7 +25,6 @@ BUILD_ASSERT(sizeof(struct log_frontend_stmesp_demux_log_header) == sizeof(uint3 struct log_frontend_stmesp_demux_active_entry { sys_snode_t node; uint32_t m_ch; - uint32_t ts; struct log_frontend_stmesp_demux_log *packet; int off; }; @@ -222,36 +221,6 @@ static void log_frontend_stmesp_demux_hw_event(uint64_t *ts, uint8_t data) mpsc_pbuf_put_data(&demux.pbuf, (const uint32_t *)&packet, wlen); } -/* Check if there are any active messages which are not completed for a significant - * amount of time. It may indicate that part of message was lost (due to reset, - * fault in the core or fault on the bus). In that case message shall be closed as - * incomplete to not block processing of other messages. - */ -static void garbage_collector(uint32_t now) -{ - sys_snode_t *node; - - SYS_SLIST_FOR_EACH_NODE(&demux.active_entries, node) { - struct log_frontend_stmesp_demux_active_entry *entry = - CONTAINER_OF(node, struct log_frontend_stmesp_demux_active_entry, node); - - if ((now - entry->ts) > CONFIG_LOG_FRONTEND_STMESP_DEMUX_GC_TIMEOUT) { - union log_frontend_stmesp_demux_packet p = {.log = entry->packet}; - - sys_slist_find_and_remove(&demux.active_entries, node); - entry->packet->content_invalid = 1; - mpsc_pbuf_commit(&demux.pbuf, p.generic); - demux.dropped++; - k_mem_slab_free(&demux.mslab, entry); - /* After removing one we need to stop as removing disrupts - * iterating over the list as current node is no longer in - * the list. - */ - break; - } - } -} - int log_frontend_stmesp_demux_packet_start(uint32_t *data, uint64_t *ts) { if (skip) { @@ -296,10 +265,9 @@ int log_frontend_stmesp_demux_packet_start(uint32_t *data, uint64_t *ts) union log_frontend_stmesp_demux_header hdr = {.raw = *data}; uint32_t pkt_len = hdr.log.total_len + offsetof(struct log_frontend_stmesp_demux_log, data); uint32_t wlen = calc_wlen(pkt_len); - uint32_t now = k_uptime_get_32(); - garbage_collector(now); err = k_mem_slab_alloc(&demux.mslab, (void **)&entry, K_NO_WAIT); + if (err < 0) { goto on_nomem; } @@ -320,7 +288,6 @@ int log_frontend_stmesp_demux_packet_start(uint32_t *data, uint64_t *ts) } entry->packet->hdr = hdr.log; entry->packet->hdr.major = m; - entry->ts = now; demux.curr = entry; sys_slist_append(&demux.active_entries, &entry->node); From 76599cacff497527d3c9809917b6d26b88ed62e7 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 004/825] Revert "[nrf fromlist] modules: hal_nordic: dvfs: patch medlow trim entry" This reverts commit 2fb756ef5c417b0f3348e18c1bffb245e3d10963. --- modules/hal_nordic/nrfs/dvfs/ld_dvfs.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c b/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c index 1faffbdb3c2..78c67ffa6a4 100644 --- a/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c +++ b/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c @@ -264,11 +264,6 @@ int32_t ld_dvfs_configure_hsfll(enum dvfs_frequency_setting oppoint) uint8_t freq_trim = get_dvfs_oppoint_data(oppoint)->new_f_trim_entry; - /* Temporary patch fixing medlow oppoint trim index */ - if (oppoint == DVFS_FREQ_MEDLOW) { - freq_trim = 2; - } - #if defined(CONFIG_SOC_NRF54H20_CPUAPP) || defined(CONFIG_SOC_NRF9280_CPUAPP) hsfll_trim.vsup = NRF_FICR->TRIM.APPLICATION.HSFLL.TRIM.VSUP; hsfll_trim.coarse = NRF_FICR->TRIM.APPLICATION.HSFLL.TRIM.COARSE[freq_trim]; From 18dfadb14b1adfa69dfcd50b690f2ae8a17911b2 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 005/825] Revert "[nrf noup] boards/nordic/nrf54l15dk: Set ROM offset by PM" This reverts commit 51545d066f84706d66db495698a8029777ff52c3. --- 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 06a426bd8ed..2b753df3515 100644 --- a/boards/nordic/nrf54l15dk/Kconfig.defconfig +++ b/boards/nordic/nrf54l15dk/Kconfig.defconfig @@ -7,7 +7,6 @@ config BT_CTLR default BT config ROM_START_OFFSET - default 0 if PARTITION_MANAGER_ENABLED default 0x800 if BOOTLOADER_MCUBOOT endif # BOARD_NRF54L15DK_NRF54L15_CPUAPP From 290bda35851a3c1efc3ba841390058b8b85f0dc2 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 006/825] Revert "[nrf fromlist] drivers: timer: grtc: Switch GRTC clock source to LFXO" This reverts commit b560787e4db54da18192e054637f5a422570ed4f. --- drivers/timer/nrf_grtc_timer.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/timer/nrf_grtc_timer.c b/drivers/timer/nrf_grtc_timer.c index 6f7e14670b3..f9a43a1d154 100644 --- a/drivers/timer/nrf_grtc_timer.c +++ b/drivers/timer/nrf_grtc_timer.c @@ -423,7 +423,7 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us) nrfy_grtc_timeout_get(NRF_GRTC) * CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC / 32768 + MAX_CC_LATCH_WAIT_TIME_US; k_busy_wait(wait_time); -#if DT_NODE_HAS_STATUS(DT_NODELABEL(lfxo), okay) && NRF_GRTC_HAS_CLKSEL +#if NRF_GRTC_HAS_CLKSEL nrfx_grtc_clock_source_set(NRF_GRTC_CLKSEL_LFXO); #endif k_spin_unlock(&lock, key); @@ -464,7 +464,7 @@ static int sys_clock_driver_init(void) #if defined(CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) && \ (defined(NRF_GRTC_HAS_CLKSEL) && (NRF_GRTC_HAS_CLKSEL == 1)) - /* Use System LFCLK as the low-frequency clock source during initialization. */ + /* Use System LFCLK as the low-frequency clock source. */ nrfx_grtc_clock_source_set(NRF_GRTC_CLKSEL_LFCLK); #endif @@ -504,12 +504,6 @@ static int sys_clock_driver_init(void) z_nrf_clock_control_lf_on(mode); #endif -#if defined(CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) && \ - DT_NODE_HAS_STATUS(DT_NODELABEL(lfxo), okay) && NRF_GRTC_HAS_CLKSEL - /* Switch to LFXO as the low-frequency clock source. */ - nrfx_grtc_clock_source_set(NRF_GRTC_CLKSEL_LFXO); -#endif - return 0; } From 4615605de159dc54016baf48f2a6fdfd6b47c463 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 007/825] Revert "[nrf fromtree] tests: drivers: Verify NRF GPIO driver with GPIO_NRFX_INTERRUPT=n" This reverts commit 96aa87c2aae419a2d04f4ee86ef12b359789a817. --- tests/drivers/gpio/gpio_nrf/README.txt | 4 --- tests/drivers/gpio/gpio_nrf/prj.conf | 1 - tests/drivers/gpio/gpio_nrf/src/main.c | 34 -------------------------- 3 files changed, 39 deletions(-) diff --git a/tests/drivers/gpio/gpio_nrf/README.txt b/tests/drivers/gpio/gpio_nrf/README.txt index c73b5ec2218..6a5927b725f 100644 --- a/tests/drivers/gpio/gpio_nrf/README.txt +++ b/tests/drivers/gpio/gpio_nrf/README.txt @@ -2,7 +2,3 @@ Nordic Semiconductor specific GPIO functions ############################################ The suite specified here tests NRF specific GPIO pin drive strength settings. - -The suite is perfomed with CONFIG_GPIO_NRFX_INTERRUPT=n -to ensure that the driver is able to properly handle -the GPIO manipulation without interrupt support. diff --git a/tests/drivers/gpio/gpio_nrf/prj.conf b/tests/drivers/gpio/gpio_nrf/prj.conf index 98d49c26369..0e799280f51 100644 --- a/tests/drivers/gpio/gpio_nrf/prj.conf +++ b/tests/drivers/gpio/gpio_nrf/prj.conf @@ -1,3 +1,2 @@ CONFIG_ZTEST=y CONFIG_GPIO=y -CONFIG_GPIO_NRFX_INTERRUPT=n diff --git a/tests/drivers/gpio/gpio_nrf/src/main.c b/tests/drivers/gpio/gpio_nrf/src/main.c index bdb8444bbeb..8627e9bab1d 100644 --- a/tests/drivers/gpio/gpio_nrf/src/main.c +++ b/tests/drivers/gpio/gpio_nrf/src/main.c @@ -58,38 +58,4 @@ ZTEST(gpio_nrf, test_gpio_high_drive_strength) err); } -/* - * Nordic Semiconductor specific, - * gpio manipulation with disabled NRFX interrupts - */ -ZTEST(gpio_nrf, test_gpio_manipulation_nrfx_int_disabled) -{ - int response; - const struct device *port; - - port = DEVICE_DT_GET(TEST_NODE); - zassert_true(device_is_ready(port), "GPIO dev is not ready"); - - response = gpio_pin_configure(port, TEST_PIN, GPIO_OUTPUT | GPIO_ACTIVE_HIGH); - zassert_ok(response, "Pin configuration failed: %d", response); - - response = gpio_pin_set(port, TEST_PIN, 0); - zassert_ok(response, "Pin low state set failed: %d", response); - - response = gpio_pin_set(port, TEST_PIN, 1); - zassert_ok(response, "Pin high state set failed: %d", response); - - response = gpio_pin_toggle(port, TEST_PIN); - zassert_ok(response, "Pin toggle failed: %d", response); - - response = gpio_pin_configure(port, TEST_PIN, GPIO_INPUT | GPIO_PULL_DOWN); - zassert_ok(response, "Failed to configure pin as input with pull down: %d", response); - - response = gpio_pin_get(port, TEST_PIN); - zassert_equal(response, 0, "Invalid pin state: %d", response); - - response = gpio_pin_interrupt_configure(port, TEST_PIN, GPIO_INT_ENABLE | GPIO_INT_HIGH_1); - zassert_equal(response, -ENOSYS); -} - ZTEST_SUITE(gpio_nrf, NULL, NULL, NULL, NULL, NULL); From 8b16af881e197201f786fafbff465215a0370537 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 008/825] Revert "[nrf fromtree] soc: nordic: Extend address validation for Haltium platform" This reverts commit de695ea5d8b7b38794dc9b23721aee914b2519b2. --- soc/nordic/validate_base_addresses.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soc/nordic/validate_base_addresses.c b/soc/nordic/validate_base_addresses.c index ece2934503e..cb398b8783d 100644 --- a/soc/nordic/validate_base_addresses.c +++ b/soc/nordic/validate_base_addresses.c @@ -335,7 +335,7 @@ CHECK_DT_REG(vmc, NRF_VMC); CHECK_DT_REG(cpuflpr_clic, NRF_FLPR_VPRCLIC); #if defined(CONFIG_SOC_NRF54L15) CHECK_DT_REG(cpuflpr_vpr, NRF_VPR00); -#elif defined(CONFIG_NRF_PLATFORM_HALTIUM) +#elif defined(CONFIG_SOC_NRF54H20) CHECK_DT_REG(cpuflpr_vpr, NRF_VPR121); CHECK_DT_REG(cpuppr_vpr, NRF_VPR130); #endif From 3882d14a23cc265cbce617050dfa25d522777125 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 009/825] Revert "[nrf fromtree] soc: nordic: nrf92: Update supported NRFS services" This reverts commit 570c90eb3ea2d7d840d1297aabe33d99a1bc79b7. --- soc/nordic/nrf92/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/soc/nordic/nrf92/Kconfig b/soc/nordic/nrf92/Kconfig index f6efecb6ad0..c3dd3a31114 100644 --- a/soc/nordic/nrf92/Kconfig +++ b/soc/nordic/nrf92/Kconfig @@ -22,8 +22,8 @@ config SOC_NRF9230_ENGB_CPUAPP select HAS_NORDIC_DMM select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE select NRFS_HAS_CLOCK_SERVICE + select NRFS_HAS_DVFS_SERVICE select NRFS_HAS_MRAM_SERVICE - select NRFS_HAS_PMIC_SERVICE select NRFS_HAS_TEMP_SERVICE select NRFS_HAS_VBUS_DETECTOR_SERVICE @@ -41,7 +41,6 @@ config SOC_NRF9230_ENGB_CPURAD select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE select NRFS_HAS_CLOCK_SERVICE select NRFS_HAS_MRAM_SERVICE - select NRFS_HAS_PMIC_SERVICE select NRFS_HAS_TEMP_SERVICE config SOC_NRF9230_ENGB_CPUPPR From a248223145144b602d10afa1295bdaba33ecfe72 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 010/825] Revert "[nrf fromtree] soc: nordic: nrf92: Set PPR hart ID to processor ID" This reverts commit 41686aff7496efed8eab7aca9a9e3163dd5283bb. --- soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuppr | 3 --- 1 file changed, 3 deletions(-) diff --git a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuppr b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuppr index 1bef8de61ca..9c29f6d295f 100644 --- a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuppr +++ b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuppr @@ -9,7 +9,4 @@ config NUM_IRQS config SYS_CLOCK_TICKS_PER_SEC default 1000 -config RV_BOOT_HART - default 13 if SOC_NRF9230_ENGB - endif # SOC_NRF9280_CPUPPR From f6303b54db6f9cbe7849bdca8f7ac04cd61fbb84 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 011/825] Revert "[nrf fromtree] snippets: Support nordic-ppr and nordic-ppr-xip on nRF92" This reverts commit 6b515b62bcd7edc5a13f06af37ddbe55d75b45d4. --- .../boards/nrf9280pdk_nrf9280_cpuapp.overlay | 17 ----------------- snippets/nordic-ppr-xip/snippet.yml | 3 --- .../boards/nrf9280pdk_nrf9280_cpuapp.overlay | 12 ------------ snippets/nordic-ppr/snippet.yml | 3 --- 4 files changed, 35 deletions(-) delete mode 100644 snippets/nordic-ppr-xip/boards/nrf9280pdk_nrf9280_cpuapp.overlay delete mode 100644 snippets/nordic-ppr/boards/nrf9280pdk_nrf9280_cpuapp.overlay diff --git a/snippets/nordic-ppr-xip/boards/nrf9280pdk_nrf9280_cpuapp.overlay b/snippets/nordic-ppr-xip/boards/nrf9280pdk_nrf9280_cpuapp.overlay deleted file mode 100644 index 4d02921660b..00000000000 --- a/snippets/nordic-ppr-xip/boards/nrf9280pdk_nrf9280_cpuapp.overlay +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor - * SPDX-License-Identifier: Apache-2.0 - */ - -&cpuppr_ram3x_region { - status = "okay"; -}; - -&cpuppr_vpr { - execution-memory = <&cpuppr_code_partition>; - /delete-property/ source-memory; -}; - -&uart135 { - status = "reserved"; -}; diff --git a/snippets/nordic-ppr-xip/snippet.yml b/snippets/nordic-ppr-xip/snippet.yml index 09b42719c47..4fa136b20e2 100644 --- a/snippets/nordic-ppr-xip/snippet.yml +++ b/snippets/nordic-ppr-xip/snippet.yml @@ -6,6 +6,3 @@ boards: nrf54h20dk/nrf54h20/cpuapp: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20dk_nrf54h20_cpuapp.overlay - nrf9280pdk/nrf9280/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf9280pdk_nrf9280_cpuapp.overlay diff --git a/snippets/nordic-ppr/boards/nrf9280pdk_nrf9280_cpuapp.overlay b/snippets/nordic-ppr/boards/nrf9280pdk_nrf9280_cpuapp.overlay deleted file mode 100644 index 75128f42a13..00000000000 --- a/snippets/nordic-ppr/boards/nrf9280pdk_nrf9280_cpuapp.overlay +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor - * SPDX-License-Identifier: Apache-2.0 - */ - -&cpuppr_ram3x_region { - status = "okay"; -}; - -&uart135 { - status = "reserved"; -}; diff --git a/snippets/nordic-ppr/snippet.yml b/snippets/nordic-ppr/snippet.yml index 48caac253a8..8257e6f0a22 100644 --- a/snippets/nordic-ppr/snippet.yml +++ b/snippets/nordic-ppr/snippet.yml @@ -6,6 +6,3 @@ boards: nrf54h20dk/nrf54h20/cpuapp: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20dk_nrf54h20_cpuapp.overlay - nrf9280pdk/nrf9280/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf9280pdk_nrf9280_cpuapp.overlay From fde65d5920fec0e2ba659f498e0617f22cf8f760 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 012/825] Revert "[nrf fromtree] modules: hal_nordic: Add NRFX_GPIOTE131_CHANNELS_USED mask" This reverts commit 57672e8d410f756ca62030e270b307c91cf84230. --- modules/hal_nordic/nrfx/nrfx_glue.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/hal_nordic/nrfx/nrfx_glue.h b/modules/hal_nordic/nrfx/nrfx_glue.h index 72764c66f04..ed6a054be10 100644 --- a/modules/hal_nordic/nrfx/nrfx_glue.h +++ b/modules/hal_nordic/nrfx/nrfx_glue.h @@ -341,11 +341,6 @@ void nrfx_busy_wait(uint32_t usec_to_wait); (~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)) - #if defined(CONFIG_BT_CTLR) /* From 508a95b938c486b68850b11dd31b306ca52ef452 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 013/825] Revert "[nrf fromtree] modules: hal_nordic: nrfx: nrfx_glue: Improve GPIOTE_CHANNELS_USED" This reverts commit 143fc5df041b2364e3687057e38e10cee572492e. --- modules/hal_nordic/nrfx/nrfx_glue.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/hal_nordic/nrfx/nrfx_glue.h b/modules/hal_nordic/nrfx/nrfx_glue.h index ed6a054be10..da0a445e7cb 100644 --- a/modules/hal_nordic/nrfx/nrfx_glue.h +++ b/modules/hal_nordic/nrfx/nrfx_glue.h @@ -337,10 +337,7 @@ void nrfx_busy_wait(uint32_t usec_to_wait); NRFX_PPI_GROUPS_USED_BY_MPSL) /** @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)) - +#define NRFX_GPIOTE130_CHANNELS_USED ~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), owned_channels) #if defined(CONFIG_BT_CTLR) /* From 765a870235559be1ddfda6dd3caf209f3667d55e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 014/825] Revert "[nrf noup] entropy: use fake entropy driver also for nrf9280pdk" This reverts commit 26f0b8847f8fcfb7bcc87738420c5218d09e0502. --- boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 6 ------ boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts | 5 ----- drivers/entropy/Kconfig.nrf_prng | 2 +- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts index c01824a2297..ceb4ddc3ff1 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts @@ -28,7 +28,6 @@ zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,canbus = &can120; - 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 a45a00e5905..1235f53df2b 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 { ipc-to-cpusys = &cpurad_cpusys_ipc; diff --git a/drivers/entropy/Kconfig.nrf_prng b/drivers/entropy/Kconfig.nrf_prng index fb78f5ce013..e1b1a9ab4fe 100644 --- a/drivers/entropy/Kconfig.nrf_prng +++ b/drivers/entropy/Kconfig.nrf_prng @@ -9,7 +9,7 @@ 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) + depends on SOC_SERIES_NRF54HX select ENTROPY_HAS_DRIVER help This is a super simple PRNG driver that can be used on nRF platforms that From 5ab73fea5a015e6a706f78f6380a5a2ab9e4f384 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 015/825] Revert "[nrf fromtree] tests: arch: arm: arm_irq_vector_table: fix compilation for nRF9280" This reverts commit a30dd6e5cc796bc55b1d61acf6ecf33b55eea54e. --- .../arm/arm_irq_vector_table/src/arm_irq_vector_table.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/arch/arm/arm_irq_vector_table/src/arm_irq_vector_table.c b/tests/arch/arm/arm_irq_vector_table/src/arm_irq_vector_table.c index 381b10a8a03..eaf9ddd2a6d 100644 --- a/tests/arch/arm/arm_irq_vector_table/src/arm_irq_vector_table.c +++ b/tests/arch/arm/arm_irq_vector_table/src/arm_irq_vector_table.c @@ -27,8 +27,8 @@ #elif defined(CONFIG_SOC_SERIES_NRF54LX) /* For nRF54L Series, use SWI00-02 interrupt lines. */ #define _ISR_OFFSET SWI00_IRQn -#elif defined(CONFIG_SOC_SERIES_NRF54HX) || defined(CONFIG_SOC_SERIES_NRF92X) -/* For nRF54H and nRF92 Series, use BELLBOARD_0-2 interrupt lines. */ +#elif defined(CONFIG_SOC_SERIES_NRF54HX) +/* For nRF54H Series, use BELLBOARD_0-2 interrupt lines. */ #define _ISR_OFFSET BELLBOARD_0_IRQn #else /* For other nRF targets, use TIMER0-2 interrupt lines. */ @@ -144,7 +144,7 @@ typedef void (*vth)(void); /* Vector Table Handler */ void nrfx_power_clock_irq_handler(void); #if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X) #define POWER_CLOCK_IRQ_NUM POWER_CLOCK_IRQn -#elif defined(CONFIG_SOC_SERIES_NRF54HX) || defined(CONFIG_SOC_SERIES_NRF92X) +#elif defined(CONFIG_SOC_SERIES_NRF54HX) #define POWER_CLOCK_IRQ_NUM -1 /* not needed */ #else #define POWER_CLOCK_IRQ_NUM CLOCK_POWER_IRQn @@ -154,8 +154,7 @@ void nrfx_power_clock_irq_handler(void); void timer0_nrf_isr(void); #define TIMER_IRQ_HANDLER timer0_nrf_isr #define TIMER_IRQ_NUM TIMER0_IRQn -#elif defined(CONFIG_SOC_SERIES_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF54HX) || \ - defined(CONFIG_SOC_SERIES_NRF92X) +#elif defined(CONFIG_SOC_SERIES_NRF54LX) || defined(CONFIG_SOC_SERIES_NRF54HX) void nrfx_grtc_irq_handler(void); #define TIMER_IRQ_HANDLER nrfx_grtc_irq_handler #define TIMER_IRQ_NUM GRTC_0_IRQn From ff52fe00bb51ea94fc6fa85a20c73ac85e6d2d28 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 016/825] Revert "[nrf fromtree] tests: drivers: watchdog: wdt_basic_api: fix compilation for nRF9280" This reverts commit 7cd8cd04685cf530f8a3a7a059324b16afb648ec. --- .../boards/nrf9280pdk_nrf9280_cpuapp.overlay | 8 -------- .../boards/nrf9280pdk_nrf9280_cpurad.overlay | 8 -------- 2 files changed, 16 deletions(-) delete mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp.overlay delete mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpurad.overlay diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp.overlay deleted file mode 100644 index 94e0d719af4..00000000000 --- a/tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpuapp.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt010 { - status = "okay"; -}; diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpurad.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpurad.overlay deleted file mode 100644 index 94e0d719af4..00000000000 --- a/tests/drivers/watchdog/wdt_basic_api/boards/nrf9280pdk_nrf9280_cpurad.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt010 { - status = "okay"; -}; From f7d523f9fe0a0f470c17a7b3ee287474616db88d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:49 +0200 Subject: [PATCH 017/825] Revert "[nrf fromtree] tests: drivers: watchdog: wdt_error_cases: fix compilation for nRF9280" This reverts commit 6a1b116c186c0717725b4c78a27b6fe879759ccd. --- .../boards/nrf9280pdk_nrf9280_cpuapp.overlay | 21 ------------------- .../boards/nrf9280pdk_nrf9280_cpurad.overlay | 21 ------------------- .../watchdog/wdt_error_cases/src/main.c | 2 +- .../watchdog/wdt_error_cases/testcase.yaml | 2 -- 4 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 tests/drivers/watchdog/wdt_error_cases/boards/nrf9280pdk_nrf9280_cpuapp.overlay delete mode 100644 tests/drivers/watchdog/wdt_error_cases/boards/nrf9280pdk_nrf9280_cpurad.overlay diff --git a/tests/drivers/watchdog/wdt_error_cases/boards/nrf9280pdk_nrf9280_cpuapp.overlay b/tests/drivers/watchdog/wdt_error_cases/boards/nrf9280pdk_nrf9280_cpuapp.overlay deleted file mode 100644 index d540137dadb..00000000000 --- a/tests/drivers/watchdog/wdt_error_cases/boards/nrf9280pdk_nrf9280_cpuapp.overlay +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt010 { - status = "okay"; -}; - -&wdt011 { - status = "disabled"; -}; - -&wdt131 { - status = "disabled"; -}; - -&wdt132 { - status = "disabled"; -}; diff --git a/tests/drivers/watchdog/wdt_error_cases/boards/nrf9280pdk_nrf9280_cpurad.overlay b/tests/drivers/watchdog/wdt_error_cases/boards/nrf9280pdk_nrf9280_cpurad.overlay deleted file mode 100644 index 7793fed2b8e..00000000000 --- a/tests/drivers/watchdog/wdt_error_cases/boards/nrf9280pdk_nrf9280_cpurad.overlay +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt010 { - status = "disabled"; -}; - -&wdt011 { - status = "okay"; -}; - -&wdt131 { - status = "disabled"; -}; - -&wdt132 { - status = "disabled"; -}; diff --git a/tests/drivers/watchdog/wdt_error_cases/src/main.c b/tests/drivers/watchdog/wdt_error_cases/src/main.c index c1adc43eea3..b16daccb2e3 100644 --- a/tests/drivers/watchdog/wdt_error_cases/src/main.c +++ b/tests/drivers/watchdog/wdt_error_cases/src/main.c @@ -42,7 +42,7 @@ #define DEFAULT_WINDOW_MIN (0U) /* Align tests to the specific target: */ -#if defined(CONFIG_SOC_NRF54L15) || defined(CONFIG_SOC_NRF54H20) || defined(CONFIG_SOC_NRF9280) +#if defined(CONFIG_SOC_NRF54L15) || defined(CONFIG_SOC_NRF54H20) #define WDT_TEST_FLAGS \ (WDT_DISABLE_SUPPORTED | WDT_FLAG_RESET_SOC_SUPPORTED | \ WDT_FLAG_ONLY_ONE_TIMEOUT_VALUE_SUPPORTED | WDT_OPT_PAUSE_IN_SLEEP_SUPPORTED | \ diff --git a/tests/drivers/watchdog/wdt_error_cases/testcase.yaml b/tests/drivers/watchdog/wdt_error_cases/testcase.yaml index 738008c754e..4fdbfaa1a4c 100644 --- a/tests/drivers/watchdog/wdt_error_cases/testcase.yaml +++ b/tests/drivers/watchdog/wdt_error_cases/testcase.yaml @@ -11,7 +11,5 @@ tests: - nrf54l15pdk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - - nrf9280pdk/nrf9280/cpuapp - - nrf9280pdk/nrf9280/cpurad integration_platforms: - nrf54l15pdk/nrf54l15/cpuapp From fecba72c911bc8137d1e31e341fb6e4f706ae174 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 018/825] Revert "[nrf fromtree] tests: drivers: adc: fix compilation for nRF9280" This reverts commit 79d0088b03ba554dc22b13048f8f96794277d236. --- .../boards/nrf9280pdk_nrf9280_cpuapp.overlay | 43 ------------------- 1 file changed, 43 deletions(-) delete mode 100644 tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp.overlay diff --git a/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp.overlay b/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp.overlay deleted file mode 100644 index d9c1f965add..00000000000 --- a/tests/drivers/adc/adc_api/boards/nrf9280pdk_nrf9280_cpuapp.overlay +++ /dev/null @@ -1,43 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2024 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_1_2"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; - zephyr,resolution = <10>; - }; -}; From 4cf577bbde05ee191c9f0c702328c1a7d72b7660 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 019/825] Revert "[nrf fromtree] tests: lib: cpp: cxx: add nRF9280 to exclusion list" This reverts commit 6a3514d0d52e14e655973f1e673ee4857566842f. --- tests/lib/cpp/cxx/testcase.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/lib/cpp/cxx/testcase.yaml b/tests/lib/cpp/cxx/testcase.yaml index 736452cc6d1..d0d29c37018 100644 --- a/tests/lib/cpp/cxx/testcase.yaml +++ b/tests/lib/cpp/cxx/testcase.yaml @@ -34,14 +34,12 @@ tests: # -std=c++98) cpp.main.cpp98: arch_exclude: posix - # Exclude nRF54L15, nRF54H20 and nRF9280 as Nordic HAL is not compatible with C++98. + # Exclude nRF54L15 and nRF54H20 as Nordic HAL is not compatible with C++98. platform_exclude: - nrf54l15pdk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - - nrf9280pdk/nrf9280/cpuapp - - nrf9280pdk/nrf9280/cpurad build_only: true extra_configs: - CONFIG_STD_CPP98=y From 3c89848ab0401f22fd10e1100091c5a3fe44b772 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 020/825] Revert "[nrf fromtree] samples: drivers: watchdog: add overlay file for nRF9280 cpuapp" This reverts commit ade7f0cb3216edcfaa13bbb3be6a2ffb445f7770. --- .../watchdog/boards/nrf9280pdk_nrf9280_cpuapp.overlay | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp.overlay diff --git a/samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp.overlay b/samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp.overlay deleted file mode 100644 index 94e0d719af4..00000000000 --- a/samples/drivers/watchdog/boards/nrf9280pdk_nrf9280_cpuapp.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt010 { - status = "okay"; -}; From 46f0c5797d5c43c00e7470b4a4413f3fbdd45175 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 021/825] Revert "[nrf fromtree] drivers: adc: nrf: Update adc driver to support nRF9280" This reverts commit 9e59a2da2b90a46165fa90eb1bda2e89fabee1e8. --- drivers/adc/adc_nrfx_saadc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/adc/adc_nrfx_saadc.c b/drivers/adc/adc_nrfx_saadc.c index 12ed83e3580..01540640035 100644 --- a/drivers/adc/adc_nrfx_saadc.c +++ b/drivers/adc/adc_nrfx_saadc.c @@ -19,7 +19,7 @@ LOG_MODULE_REGISTER(adc_nrfx_saadc); #if (NRF_SAADC_HAS_AIN_AS_PIN) -#if defined(CONFIG_SOC_NRF54H20) || defined(CONFIG_SOC_NRF9280) +#if defined(CONFIG_SOC_NRF54H20) static const uint8_t saadc_psels[NRF_SAADC_AIN7 + 1] = { [NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), [NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), @@ -62,9 +62,9 @@ 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_SOC_NRF54H20) || defined(CONFIG_SOC_NRF9280) +#ifdef CONFIG_SOC_NRF54H20 -/* nRF54H20 and nRF9280 always use bounce buffers in RAM */ +/* nRF54H20 always uses bounce buffers in RAM */ #define SAADC_MEMORY_SECTION \ COND_CODE_1(DT_NODE_HAS_PROP(DT_NODELABEL(adc), memory_regions), \ @@ -76,7 +76,7 @@ static uint16_t adc_samples_buffer[SAADC_CH_NUM] SAADC_MEMORY_SECTION; #define ADC_BUFFER_IN_RAM -#endif /* defined(CONFIG_SOC_NRF54H20) || defined(CONFIG_SOC_NRF9280) */ +#endif /* CONFIG_SOC_NRF54H20 */ struct driver_data { struct adc_context ctx; @@ -608,7 +608,7 @@ static const struct adc_driver_api adc_nrfx_driver_api = { #endif #if defined(CONFIG_SOC_NRF54L15) .ref_internal = 900, -#elif defined(CONFIG_SOC_NRF54H20) || defined(CONFIG_SOC_NRF9280) +#elif defined(CONFIG_SOC_NRF54H20) .ref_internal = 1024, #else .ref_internal = 600, From ef00b109a56672d37464872419ea5072b6db0eee Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 022/825] Revert "[nrf fromtree] modules: hal_nordic: nrf: add nRF9280 support" This reverts commit 676cf6491f185a9de32fe8ee93d38e0526fe42b4. --- modules/hal_nordic/nrfs/Kconfig | 4 ++-- modules/hal_nordic/nrfs/dvfs/ld_dvfs.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/hal_nordic/nrfs/Kconfig b/modules/hal_nordic/nrfs/Kconfig index 49ffc2595e1..d9031f85b68 100644 --- a/modules/hal_nordic/nrfs/Kconfig +++ b/modules/hal_nordic/nrfs/Kconfig @@ -36,7 +36,7 @@ config NRFS_HAS_VBUS_DETECTOR_SERVICE config NRFS bool "nRF Services Support" - select NRFS_LOCAL_DOMAIN if (SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD || SOC_NRF9280_CPUAPP || SOC_NRF9280_CPURAD) + select NRFS_LOCAL_DOMAIN if (SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD) depends on HAS_NRFS depends on !MISRA_SANE default y if !ZTEST @@ -98,7 +98,7 @@ config NRFS_PMIC_SERVICE_ENABLED config NRFS_DVFS_SERVICE_ENABLED bool "DVFS service" depends on NRFS_HAS_DVFS_SERVICE - default y if SOC_NRF54H20_CPUAPP || SOC_NRF9280_CPUAPP + default y if SOC_NRF54H20_CPUAPP config NRFS_DIAG_SERVICE_ENABLED bool "System Diagnostics service (only for development purposes)" diff --git a/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c b/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c index 78c67ffa6a4..047d961a59c 100644 --- a/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c +++ b/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c @@ -264,7 +264,7 @@ int32_t ld_dvfs_configure_hsfll(enum dvfs_frequency_setting oppoint) uint8_t freq_trim = get_dvfs_oppoint_data(oppoint)->new_f_trim_entry; -#if defined(CONFIG_SOC_NRF54H20_CPUAPP) || defined(CONFIG_SOC_NRF9280_CPUAPP) +#ifdef CONFIG_SOC_NRF54H20_CPUAPP hsfll_trim.vsup = NRF_FICR->TRIM.APPLICATION.HSFLL.TRIM.VSUP; hsfll_trim.coarse = NRF_FICR->TRIM.APPLICATION.HSFLL.TRIM.COARSE[freq_trim]; hsfll_trim.fine = NRF_FICR->TRIM.APPLICATION.HSFLL.TRIM.FINE[freq_trim]; From 69e7f8262c3a2a8f196768ef181f3e7e1826c30a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 023/825] Revert "[nrf fromtree] boards: nordic: add initial support for nRF9280 PDK" This reverts commit 479cd853855203438ac922fa83b06d90d13d432a. --- boards/nordic/nrf9280pdk/Kconfig.defconfig | 24 -- boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk | 8 - boards/nordic/nrf9280pdk/board.cmake | 14 - boards/nordic/nrf9280pdk/board.yml | 8 - boards/nordic/nrf9280pdk/doc/index.rst | 175 ---------- .../nrf9280pdk_nrf9280-ipc_conf.dtsi | 51 --- .../nrf9280pdk_nrf9280-memory_map.dtsi | 276 --------------- .../nrf9280pdk_nrf9280-pinctrl.dtsi | 82 ----- .../nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts | 316 ------------------ .../nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.yaml | 24 -- .../nrf9280pdk_nrf9280_cpuapp_defconfig | 28 -- .../nrf9280pdk/nrf9280pdk_nrf9280_cpuppr.dts | 60 ---- .../nrf9280pdk/nrf9280pdk_nrf9280_cpuppr.yaml | 18 - .../nrf9280pdk_nrf9280_cpuppr_defconfig | 14 - .../nrf9280pdk_nrf9280_cpuppr_xip.dts | 7 - .../nrf9280pdk_nrf9280_cpuppr_xip.yaml | 14 - .../nrf9280pdk_nrf9280_cpuppr_xip_defconfig | 13 - .../nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts | 119 ------- .../nrf9280pdk/nrf9280pdk_nrf9280_cpurad.yaml | 19 -- .../nrf9280pdk_nrf9280_cpurad_defconfig | 25 -- .../support/nrf9280_cpuapp.JLinkScript | 41 --- .../support/nrf9280_cpurad.JLinkScript | 48 --- 22 files changed, 1384 deletions(-) delete mode 100644 boards/nordic/nrf9280pdk/Kconfig.defconfig delete mode 100644 boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk delete mode 100644 boards/nordic/nrf9280pdk/board.cmake delete mode 100644 boards/nordic/nrf9280pdk/board.yml delete mode 100644 boards/nordic/nrf9280pdk/doc/index.rst delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf.dtsi delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-pinctrl.dtsi delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.yaml delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr.dts delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr.yaml delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_defconfig delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip.dts delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip.yaml delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip_defconfig delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.yaml delete mode 100644 boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad_defconfig delete mode 100644 boards/nordic/nrf9280pdk/support/nrf9280_cpuapp.JLinkScript delete mode 100644 boards/nordic/nrf9280pdk/support/nrf9280_cpurad.JLinkScript diff --git a/boards/nordic/nrf9280pdk/Kconfig.defconfig b/boards/nordic/nrf9280pdk/Kconfig.defconfig deleted file mode 100644 index c5c3576b4c2..00000000000 --- a/boards/nordic/nrf9280pdk/Kconfig.defconfig +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_NRF9280PDK_NRF9280_CPUAPP - -config BT_HCI_IPC - default y if BT - -endif # BOARD_NRF9280PDK_NRF9280_CPUAPP - -if BOARD_NRF9280PDK_NRF9280_CPURAD - -config BT_CTLR - default y if BT - -endif # BOARD_NRF9280PDK_NRF9280_CPURAD - -if BOARD_NRF9280PDK_NRF9280_CPUPPR - -# As PPR has limited memory most of tests does not fit with asserts enabled. -config ASSERT - default n if ZTEST - -endif # BOARD_NRF9280PDK_NRF9280_CPUPPR diff --git a/boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk b/boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk deleted file mode 100644 index 54865a1b235..00000000000 --- a/boards/nordic/nrf9280pdk/Kconfig.nrf9280pdk +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_NRF9280PDK - 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 diff --git a/boards/nordic/nrf9280pdk/board.cmake b/boards/nordic/nrf9280pdk/board.cmake deleted file mode 100644 index 0690bf366bf..00000000000 --- a/boards/nordic/nrf9280pdk/board.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) - -if(CONFIG_BOARD_NRF9280PDK_NRF9280_CPUAPP OR CONFIG_BOARD_NRF9280PDK_NRF9280_CPURAD) - if(CONFIG_BOARD_NRF9280PDK_NRF9280_CPUAPP) - set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf9280_cpuapp.JLinkScript) - else() - set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf9280_cpurad.JLinkScript) - endif() - - board_runner_args(jlink "--device=CORTEX-M33" "--speed=4000" "--tool-opt=-jlinkscriptfile ${JLINKSCRIPTFILE}") - include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) -endif() diff --git a/boards/nordic/nrf9280pdk/board.yml b/boards/nordic/nrf9280pdk/board.yml deleted file mode 100644 index 450ef9db901..00000000000 --- a/boards/nordic/nrf9280pdk/board.yml +++ /dev/null @@ -1,8 +0,0 @@ -board: - name: nrf9280pdk - vendor: nordic - socs: - - name: nrf9280 - variants: - - name: xip - cpucluster: cpuppr diff --git a/boards/nordic/nrf9280pdk/doc/index.rst b/boards/nordic/nrf9280pdk/doc/index.rst deleted file mode 100644 index ef230148d5e..00000000000 --- a/boards/nordic/nrf9280pdk/doc/index.rst +++ /dev/null @@ -1,175 +0,0 @@ -.. _nrf9280pdk_nrf9280: - -nRF9280 PDK -########### - -Overview -******** - -.. note:: - - All software for the nRF9280 SiP is experimental and hardware availability - is restricted to the participants in the limited sampling program. - -The nRF9280 DK is a single-board development kit for evaluation and development -on the Nordic nRF9280 System-in-Package (SiP). - -The nRF9280 is a multicore SiP with: - -* an Arm Cortex-M33 core with DSP instructions, FPU, and Armv8-M Security - Extensions, running at up to 320 MHz, referred to as the **application core** -* an Arm Cortex-M33 core with DSP instructions, FPU, and Armv8-M Security - Extensions, running at up to 256 MHz, referred to as the **radio core**. - -The ``nrf9280pdk/nrf9280/cpuapp`` board target provides support for -the application core on the nRF9280 SiP. -The ``nrf9280pdk/nrf9280/cpurad`` board target provides support for -the radio core on the nRF9280 SiP. -The ``nrf9280pdk/nrf9280/cpuppr`` board target provides support for -the PPR core on the nRF9280 SiP. - -nRF9280 SiP provides support for the following devices: - -* :abbr:`ADC (Analog to Digital Converter)` -* CLOCK -* :abbr:`GPIO (General Purpose Input Output)` -* :abbr:`GRTC (Global real-time counter)` -* :abbr:`I2C (Inter-Integrated Circuit)` -* MRAM -* :abbr:`PWM (Pulse Width Modulation)` -* RADIO (Bluetooth Low Energy and 802.15.4) -* :abbr:`SPI (Serial Peripheral Interface)` -* :abbr:`UART (Universal asynchronous receiver-transmitter)` -* :abbr:`USB (Universal Serial Bus)` -* :abbr:`WDT (Watchdog Timer)` - -Hardware -******** - -nRF9280 DK has two crystal oscillators: - -* High-frequency 32 MHz crystal oscillator (HFXO) -* Low-frequency 32.768 kHz crystal oscillator (LFXO) - -Supported Features -================== - -The ``nrf9280pdk/nrf9280/cpuapp`` board target supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| GRTC | on-chip | system clock | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -The ``nrf9280pdk/nrf9280/cpurad`` board target supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| GRTC | on-chip | system clock | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -The ``nrf9280pdk/nrf9280/cpuppr`` board target supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| GRTC | on-chip | system clock | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. - -Connections and IOs -=================== - -LEDs ----- - -* LED1 (green) = P9.02 -* LED2 (green) = P9.03 -* LED3 (green) = P9.04 -* LED4 (green) = P9.05 - -Push buttons ------------- - -* BUTTON1 = P0.8 -* BUTTON2 = P0.9 -* BUTTON3 = P0.10 -* BUTTON4 = P0.11 -* RESET (SW1) - -Programming and Debugging -************************* - -Applications for both the ``nrf9280pdk/nrf9280/cpuapp`` and -``nrf9280pdk/nrf9280/cpurad`` board targets 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. - -Flashing -======== - -As an example, this section shows how to build and flash the :ref:`hello_world` -application. - -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 nRF9280 DK, complete the following steps: - -1. Connect the nRF9280 DK to your computer using the IMCU USB port on the DK. -#. Build the sample by running the following command: - - .. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :board: nrf9280pdk/nrf9280/cpuapp - :goals: build flash - -Testing the LEDs and buttons in the nRF9280 DK -*********************************************** - -There are 2 samples that allow you to test that the buttons (switches) and LEDs -on the board are working properly with Zephyr: - -* :zephyr:code-sample:`blinky` -* :zephyr:code-sample:`button` - -You can build and flash the examples to make sure Zephyr is running correctly on -your board. The button and LED definitions can be found in -:zephyr_file:`boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts`. diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf.dtsi deleted file mode 100644 index 944dd7fb6ab..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-ipc_conf.dtsi +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - ipc { - cpusec_cpuapp_ipc: ipc-1-2 { - compatible = "zephyr,ipc-icmsg"; - status = "disabled"; - mboxes = <&cpusec_bellboard 12>, - <&cpuapp_bellboard 0>; - }; - - cpusec_cpurad_ipc: ipc-1-3 { - compatible = "zephyr,ipc-icmsg"; - status = "disabled"; - mboxes = <&cpusec_bellboard 18>, - <&cpurad_bellboard 0>; - }; - - cpuapp_cpurad_ipc: ipc-2-3 { - compatible = "zephyr,ipc-icbmsg"; - status = "disabled"; - mboxes = <&cpuapp_bellboard 18>, - <&cpurad_bellboard 12>; - }; - - cpuapp_cpusys_ipc: ipc-2-12 { - compatible = "zephyr,ipc-icmsg"; - status = "disabled"; - mboxes = <&cpuapp_bellboard 6>, - <&cpusys_vevif 12>; - }; - - cpuapp_cpuppr_ipc: ipc-2-13 { - compatible = "zephyr,ipc-icmsg"; - status = "disabled"; - mboxes = <&cpuapp_bellboard 13>, - <&cpuppr_vevif 12>; - }; - - cpurad_cpusys_ipc: ipc-3-12 { - compatible = "zephyr,ipc-icmsg"; - status = "disabled"; - mboxes = <&cpurad_bellboard 6>, - <&cpusys_vevif 18>; - }; - }; -}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi deleted file mode 100644 index 78e3be8825f..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map.dtsi +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include - -/ { - reserved-memory { - /* The first 64kb are reserved for SecDom. - * The next 4kb are reserved for IPC between SecDom and Cellcore. - */ - - cpurad_ram0x_region: memory@2f011000 { - compatible = "nordic,owned-memory"; - reg = <0x2f011000 DT_SIZE_K(4)>; - status = "disabled"; - perm-read; - perm-write; - perm-secure; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2f011000 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)>; - }; - }; - - cpuapp_ram0x_region: memory@2f012000 { - compatible = "nordic,owned-memory"; - reg = <0x2f012000 DT_SIZE_K(516)>; - status = "disabled"; - perm-read; - perm-write; - perm-secure; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2f012000 0x81000>; - - 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(512)>; - }; - }; - - cpuapp_cpurad_ram0x_region: memory@2f0cf000 { - compatible = "nordic,owned-memory"; - reg = <0x2f0cf000 DT_SIZE_K(4)>; - status = "disabled"; - perm-read; - perm-write; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2f0cf000 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_cpucell_ram0x_region: memory@2f0d0000 { - reg = <0x2f0d0000 DT_SIZE_K(36)>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2f0d0000 0x9000>; - - /* Control region, with ICmsg buffers. - * Size is fixed. - */ - cpuapp_cpucell_ipc_shm_ctrl: memory@0 { - reg = <0x0 0x1000>; - }; - - /* TX heap, user defined */ - cpuapp_cpucell_ipc_shm_heap: memory@1000 { - reg = <0x1000 0x4000>; - }; - - /* RX heap, user defined */ - cpucell_cpuapp_ipc_shm_heap: memory@5000 { - reg = <0x5000 0x4000>; - }; - }; - - /* Shared memory ownership. - * TODO: - * remove these two after https://github.com/zephyrproject-rtos/zephyr/pull/72273 - * and let cpuapp_cpucell_ram0x_region use the `access` binding to describe - * the shared memory ownership. - */ - - cpuapp_cpucell_ipc_shm: memory@2 { - compatible = "nordic,owned-memory"; - reg = <0x2f0d0000 DT_SIZE_K(36)>; - owner-id = <2>; - perm-read; - perm-write; - status = "disabled"; - }; - - cpucell_cpuapp_ipc_shm: memory@4 { - compatible = "nordic,owned-memory"; - reg = <0x2f0d0000 DT_SIZE_K(36)>; - owner-id = <4>; - perm-read; - perm-write; - status = "disabled"; - }; - - shared_ram20_region: memory@2f88f000 { - reg = <0x2f88f000 DT_SIZE_K(4)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2f88f000 0x1000>; - - cpuapp_cpusys_ipc_shm: memory@ce0 { - reg = <0xce0 0x80>; - }; - - cpusys_cpuapp_ipc_shm: memory@d60 { - reg = <0xd60 0x80>; - }; - - cpurad_cpusys_ipc_shm: memory@e00 { - reg = <0xe00 0x80>; - }; - - cpusys_cpurad_ipc_shm: memory@e80 { - reg = <0xe80 0x80>; - }; - }; - - ram21_region: memory@2f890000 { - compatible = "nordic,owned-memory"; - status = "disabled"; - reg = <0x2f890000 DT_SIZE_K(32)>; - perm-read; - perm-write; - perm-secure; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2f890000 0x8000>; - - dma_fast_region: memory@4000 { - compatible = "zephyr,memory-region"; - reg = <0x4000 DT_SIZE_K(16)>; - status = "disabled"; - #memory-region-cells = <0>; - zephyr,memory-region = "DMA_RAM21"; - zephyr,memory-attr = <( DT_MEM_DMA | DT_MEM_CACHEABLE )>; - }; - }; - - cpuppr_ram3x_region: memory@2fc00000 { - compatible = "nordic,owned-memory"; - reg = <0x2fc00000 DT_SIZE_K(24)>; - status = "disabled"; - perm-read; - perm-write; - perm-execute; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2fc00000 0x6000>; - - cpuppr_code_data: memory@0 { - reg = <0x0 DT_SIZE_K(22)>; - }; - - cpuapp_cpuppr_ipc_shm: memory@5800 { - reg = <0x5800 DT_SIZE_K(1)>; - }; - - cpuppr_cpuapp_ipc_shm: memory@5c00 { - reg = <0x5c00 DT_SIZE_K(1)>; - }; - }; - - shared_ram3x_region: memory@2fc06000 { - compatible = "nordic,owned-memory"; - reg = <0x2fc06000 DT_SIZE_K(8)>; - status = "disabled"; - perm-read; - perm-write; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2fc06000 0x4000>; - - cpuapp_dma_region: memory@0 { - compatible = "zephyr,memory-region"; - reg = <0x0 DT_SIZE_K(4)>; - status = "disabled"; - #memory-region-cells = <0>; - zephyr,memory-region = "DMA_RAM3x_APP"; - zephyr,memory-attr = <( DT_MEM_DMA )>; - }; - - cpurad_dma_region: memory@1000 { - compatible = "zephyr,memory-region"; - reg = <0x1000 0x80>; - status = "disabled"; - #memory-region-cells = <0>; - zephyr,memory-region = "DMA_RAM3x_RAD"; - zephyr,memory-attr = <( DT_MEM_DMA )>; - }; - }; - }; -}; - -&mram1x { - cpurad_rx_partitions: cpurad-rx-partitions { - compatible = "nordic,owned-partitions", "fixed-partitions"; - status = "disabled"; - perm-read; - perm-execute; - perm-secure; - #address-cells = <1>; - #size-cells = <1>; - - cpurad_slot0_partition: partition@402000 { - reg = <0x402000 DT_SIZE_K(256)>; - }; - }; - - cpuapp_rx_partitions: cpuapp-rx-partitions { - compatible = "nordic,owned-partitions", "fixed-partitions"; - status = "disabled"; - perm-read; - perm-execute; - perm-secure; - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_slot0_partition: partition@442000 { - reg = <0x442000 DT_SIZE_K(1024)>; - }; - - cpuppr_code_partition: partition@542000 { - reg = <0x542000 DT_SIZE_K(64)>; - }; - }; - - cpuapp_rw_partitions: cpuapp-rw-partitions { - compatible = "nordic,owned-partitions", "fixed-partitions"; - status = "disabled"; - perm-read; - perm-write; - perm-secure; - #address-cells = <1>; - #size-cells = <1>; - - dfu_partition: partition@600000 { - reg = <0x600000 DT_SIZE_K(512)>; - }; - - storage_partition: partition@680000 { - reg = <0x680000 DT_SIZE_K(24)>; - }; - }; -}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-pinctrl.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-pinctrl.dtsi deleted file mode 100644 index 48067a7052c..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-pinctrl.dtsi +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2024 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 = , - , - , - ; - }; - }; - - /omit-if-no-ref/ exmif_default: exmif_default { - group1 { - psels = , - , - ; - nordic,drive-mode = ; - }; - }; - - /omit-if-no-ref/ can120_default: can120_default { - group1 { - psels = , - ; - }; - }; - - /omit-if-no-ref/ pwm130_default: pwm130_default { - group1 { - psels = ; - }; - }; - - /omit-if-no-ref/ pwm130_sleep: pwm130_sleep { - group1 { - psels = ; - low-power-enable; - }; - }; -}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts deleted file mode 100644 index ceb4ddc3ff1..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.dts +++ /dev/null @@ -1,316 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include -#include "nrf9280pdk_nrf9280-memory_map.dtsi" -#include "nrf9280pdk_nrf9280-ipc_conf.dtsi" -#include "nrf9280pdk_nrf9280-pinctrl.dtsi" - -/delete-node/ &cpurad_cpusys_ipc; -/delete-node/ &cpusec_cpurad_ipc; - -/ { - compatible = "nordic,nrf9280pdk_nrf9280-cpuapp"; - model = "Nordic nRF9280 DK nRF9280 Application MCU"; - - chosen { - zephyr,console = &uart136; - zephyr,code-partition = &cpuapp_slot0_partition; - 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,canbus = &can120; - }; - - aliases { - led0 = &led0; - led1 = &led1; - led2 = &led2; - led3 = &led3; - resetinfo = &cpuapp_resetinfo; - pwm-led0 = &pwm_led0; - sw0 = &button0; - sw1 = &button1; - sw2 = &button2; - sw3 = &button3; - ipc-to-cpusys = &cpuapp_cpusys_ipc; - watchdog0 = &wdt010; - }; - - buttons { - compatible = "gpio-keys"; - - button0: button_0 { - gpios = <&gpio0 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - label = "Push button 0"; - zephyr,code = ; - }; - - button1: button_1 { - gpios = <&gpio0 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - label = "Push button 1"; - zephyr,code = ; - }; - - button2: button_2 { - gpios = <&gpio0 10 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - label = "Push button 2"; - zephyr,code = ; - }; - - button3: button_3 { - gpios = <&gpio0 11 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - label = "Push button 3"; - zephyr,code = ; - }; - }; - - leds { - compatible = "gpio-leds"; - - led0: led_0 { - gpios = <&gpio9 2 GPIO_ACTIVE_HIGH>; - label = "Green LED 0"; - }; - - led1: led_1 { - gpios = <&gpio9 3 GPIO_ACTIVE_HIGH>; - label = "Green LED 1"; - }; - - led2: led_2 { - gpios = <&gpio9 4 GPIO_ACTIVE_HIGH>; - label = "Green LED 2"; - }; - - led3: led_3 { - gpios = <&gpio9 5 GPIO_ACTIVE_HIGH>; - label = "Green LED 3"; - }; - }; - - pwmleds { - compatible = "pwm-leds"; - /* - * LEDs are connected to GPIO Port 9 - pins 2-5. There is no valid hardware - * configuration to pass PWM signal on pins 0 and 1. First valid config is P9.2. - * Signal on PWM130's channel 0 can be passed directly on GPIO Port 9 pin 2. - */ - pwm_led0: pwm_led_0 { - pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; - }; - }; -}; - -&cpuapp_ram0x_region { - status = "okay"; -}; - -&cpuapp_cpurad_ram0x_region { - status = "okay"; -}; - -&cpuapp_cpucell_ipc_shm { - status = "okay"; -}; - -&cpucell_cpuapp_ipc_shm { - status = "okay"; -}; - -&shared_ram3x_region { - status = "okay"; -}; - -&ram21_region { - status = "okay"; -}; - -&cpuapp_bellboard { - status = "okay"; - interrupts = <96 NRF_DEFAULT_IRQ_PRIORITY>; - interrupt-names = "irq0"; - /* The following bells on this bellboard are rang by these cores - * - Bell 0: cpusec - * - Bell 6: cpusys - * - Bell 13: cpuppr - * - Bell 18: cpurad - * - Bells 24, 25, 29, 31: cpucell - */ - nordic,interrupt-mapping = <0xA3042041 0>; -}; - -&cpurad_bellboard { - status = "okay"; -}; - -&cpucell_bellboard { - status = "okay"; -}; - -&cpusys_vevif { - status = "okay"; -}; - -&cpusec_cpuapp_ipc { - mbox-names = "tx", "rx"; - tx-region = <&cpuapp_cpusec_ipc_shm>; - rx-region = <&cpusec_cpuapp_ipc_shm>; -}; - -ipc0: &cpuapp_cpurad_ipc { - status = "okay"; - mbox-names = "rx", "tx"; - tx-region = <&cpuapp_cpurad_ipc_shm>; - rx-region = <&cpurad_cpuapp_ipc_shm>; - tx-blocks = <32>; - rx-blocks = <32>; - - bt_hci_ipc0: bt_hci_ipc0 { - compatible = "zephyr,bt-hci-ipc"; - status = "okay"; - }; -}; - -&cpuapp_cpusys_ipc { - status = "okay"; - mbox-names = "rx", "tx"; - tx-region = <&cpuapp_cpusys_ipc_shm>; - rx-region = <&cpusys_cpuapp_ipc_shm>; -}; - -&cpuapp_cpuppr_ipc { - mbox-names = "rx", "tx"; - tx-region = <&cpuapp_cpuppr_ipc_shm>; - rx-region = <&cpuppr_cpuapp_ipc_shm>; -}; - -&cpuapp_dma_region { - status = "okay"; -}; - -&dma_fast_region { - status = "okay"; -}; - -&cpuapp_rx_partitions { - status = "okay"; -}; - -&cpuapp_rw_partitions { - status = "okay"; -}; - -&cpuppr_vpr { - execution-memory = <&cpuppr_code_data>; - source-memory = <&cpuppr_code_partition>; -}; - -&gpiote130 { - status = "okay"; - owned-channels = <0 1 2 3 4 5 6 7>; -}; - -&gpio0 { - status = "okay"; -}; - -&gpio2 { - status = "okay"; -}; - -&gpio9 { - status = "okay"; -}; - -&grtc { - status = "okay"; - child-owned-channels = <5 6>; - nonsecure-channels = <5 6>; - owned-channels = <4 5 6>; -}; - -&uart135 { - current-speed = <115200>; - pinctrl-0 = <&uart135_default>; - pinctrl-1 = <&uart135_sleep>; - pinctrl-names = "default", "sleep"; -}; - -&uart136 { - status = "okay"; - memory-regions = <&cpuapp_dma_region>; - current-speed = <115200>; - pinctrl-0 = <&uart136_default>; - pinctrl-1 = <&uart136_sleep>; - pinctrl-names = "default", "sleep"; - hw-flow-control; -}; - -&gpio6 { - status = "okay"; -}; - -&exmif { - cs-gpios = <&gpio6 3 GPIO_ACTIVE_LOW>; - pinctrl-0 = <&exmif_default>; - pinctrl-names = "default"; - status = "okay"; - mx25uw63: mx25uw6345g@0 { - compatible = "jedec,spi-nor"; - status = "disabled"; - reg = <0>; - spi-max-frequency = ; - jedec-id = [c2 84 37]; - sfdp-bfp = [ - e5 20 8a ff ff ff ff 03 00 ff 00 ff 00 ff 00 ff - ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 10 d8 - 00 ff 00 ff 87 79 01 00 84 12 00 c4 cc 04 67 46 - 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 - ]; - size = <67108864>; - has-dpd; - t-enter-dpd = <10000>; - t-exit-dpd = <30000>; - }; -}; - -&cpuapp_ieee802154 { - status = "okay"; -}; - -zephyr_udc0: &usbhs { - status = "okay"; -}; - -&canpll { - status = "okay"; -}; - -&can120 { - status = "okay"; - pinctrl-0 = <&can120_default>; - pinctrl-names = "default"; -}; - -&pwm130 { - status = "okay"; - pinctrl-0 = <&pwm130_default>; - pinctrl-1 = <&pwm130_sleep>; - pinctrl-names = "default", "sleep"; - memory-regions = <&cpuapp_dma_region>; -}; - -&adc { - memory-regions = <&cpuapp_dma_region>; - status = "okay"; -}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.yaml b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.yaml deleted file mode 100644 index 9c2aff88052..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf9280pdk/nrf9280/cpuapp -name: nRF9280-DK-nRF9280-Application -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -sysbuild: true -ram: 512 -flash: 1024 -supported: - - adc - - can - - counter - - gpio - - i2c - - pwm - - spi - - watchdog - - usbd diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig deleted file mode 100644 index e1ba596d135..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuapp_defconfig +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2024 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 - -# 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 diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr.dts deleted file mode 100644 index 5da976ef70d..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr.dts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include -#include "nrf9280pdk_nrf9280-memory_map.dtsi" -#include "nrf9280pdk_nrf9280-ipc_conf.dtsi" -#include "nrf9280pdk_nrf9280-pinctrl.dtsi" - -/delete-node/ &cpuapp_cpurad_ipc; -/delete-node/ &cpuapp_cpusys_ipc; -/delete-node/ &cpurad_cpusys_ipc; -/delete-node/ &cpusec_cpuapp_ipc; -/delete-node/ &cpusec_cpurad_ipc; - -/ { - compatible = "nordic,nrf9280pdk_nrf9280-cpuppr"; - model = "Nordic nRF9280 DK nRF9280 Peripheral Processor MCU"; - #address-cells = <1>; - #size-cells = <1>; - - chosen { - zephyr,console = &uart135; - zephyr,code-partition = &cpuppr_code_partition; - zephyr,flash = &mram1x; - zephyr,sram = &cpuppr_code_data; - zephyr,shell-uart = &uart135; - }; -}; - -&cpuapp_cpuppr_ipc { - mbox-names = "tx", "rx"; - tx-region = <&cpuppr_cpuapp_ipc_shm>; - rx-region = <&cpuapp_cpuppr_ipc_shm>; -}; - -&grtc { - status = "okay"; - owned-channels = <5>; -}; - -&uart135 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart135_default>; - pinctrl-1 = <&uart135_sleep>; - pinctrl-names = "default", "sleep"; - hw-flow-control; -}; - -&uart136 { - current-speed = <115200>; - pinctrl-0 = <&uart136_default>; - pinctrl-1 = <&uart136_sleep>; - pinctrl-names = "default", "sleep"; -}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr.yaml b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr.yaml deleted file mode 100644 index 958b5d462ae..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf9280pdk/nrf9280/cpuppr -name: nRF9280-DK-nRF9280-PPR -type: mcu -arch: riscv -toolchain: - - zephyr -sysbuild: true -ram: 22 -flash: 22 -supported: - - counter - - gpio - - i2c - - pwm - - spi diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_defconfig b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_defconfig deleted file mode 100644 index b6ee6107d46..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_defconfig +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2024 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 - -# Execute from RAM -CONFIG_XIP=n diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip.dts deleted file mode 100644 index 30034d2d4dc..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip.dts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf9280pdk_nrf9280_cpuppr.dts" diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip.yaml b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip.yaml deleted file mode 100644 index d57f9c8d1be..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf9280pdk/nrf9280/cpuppr/xip -name: nRF9280-DK-nRF9280-PPR (MRAM XIP) -type: mcu -arch: riscv -toolchain: - - zephyr -sysbuild: true -ram: 22 -flash: 64 -supported: - - gpio diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip_defconfig b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip_defconfig deleted file mode 100644 index d73f271870b..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpuppr_xip_defconfig +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2024 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 - -CONFIG_XIP=y diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts deleted file mode 100644 index 1235f53df2b..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.dts +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include -#include "nrf9280pdk_nrf9280-memory_map.dtsi" -#include "nrf9280pdk_nrf9280-ipc_conf.dtsi" -#include "nrf9280pdk_nrf9280-pinctrl.dtsi" - -/delete-node/ &cpuapp_cpuppr_ipc; -/delete-node/ &cpuapp_cpusys_ipc; -/delete-node/ &cpusec_cpuapp_ipc; - -/ { - compatible = "nordic,nrf9280pdk_nrf9280-cpurad"; - model = "Nordic nRF9280 DK nRF9280 Radio MCU"; - - chosen { - zephyr,console = &uart135; - zephyr,code-partition = &cpurad_slot0_partition; - zephyr,flash = &mram1x; - zephyr,sram = &cpurad_ram0; - zephyr,shell-uart = &uart135; - zephyr,ieee802154 = &cpurad_ieee802154; - zephyr,bt-hci-ipc = &ipc0; - nordic,802154-spinel-ipc = &ipc0; - }; - aliases { - ipc-to-cpusys = &cpurad_cpusys_ipc; - resetinfo = &cpurad_resetinfo; - }; -}; - -&shared_ram3x_region { - status = "okay"; -}; - -&cpuapp_cpurad_ram0x_region { - status = "okay"; -}; - -&cpurad_bellboard { - status = "okay"; - interrupts = <96 NRF_DEFAULT_IRQ_PRIORITY>; - interrupt-names = "irq0"; - /* The following bells on this bellboard are rang by these cores - * - Bell 0: cpusec - * - Bell 6: cpusys - * - Bell 12: cpuapp - */ - nordic,interrupt-mapping = <0x00001041 0>; -}; - -&cpuapp_bellboard { - status = "okay"; -}; - -&cpusys_vevif { - status = "okay"; -}; - -&cpusec_cpurad_ipc { - mbox-names = "tx", "rx"; - tx-region = <&cpurad_cpusec_ipc_shm>; - rx-region = <&cpusec_cpurad_ipc_shm>; -}; - -ipc0: &cpuapp_cpurad_ipc { - status = "okay"; - mbox-names = "tx", "rx"; - tx-region = <&cpurad_cpuapp_ipc_shm>; - rx-region = <&cpuapp_cpurad_ipc_shm>; - tx-blocks = <32>; - rx-blocks = <32>; -}; - -&cpurad_cpusys_ipc { - status = "okay"; - mbox-names = "rx", "tx"; - tx-region = <&cpurad_cpusys_ipc_shm>; - rx-region = <&cpusys_cpurad_ipc_shm>; -}; - -&cpurad_dma_region { - status = "okay"; -}; - -&cpurad_rx_partitions { - status = "okay"; -}; - -&grtc { - status = "okay"; -}; - -&uart135 { - status = "okay"; - memory-regions = <&cpurad_dma_region>; - current-speed = <115200>; - pinctrl-0 = <&uart135_default>; - pinctrl-1 = <&uart135_sleep>; - pinctrl-names = "default", "sleep"; - hw-flow-control; -}; - -&uart136 { - current-speed = <115200>; - pinctrl-0 = <&uart136_default>; - pinctrl-1 = <&uart136_sleep>; - pinctrl-names = "default", "sleep"; -}; - -&cpurad_ieee802154 { - status = "okay"; -}; diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.yaml b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.yaml deleted file mode 100644 index 543a7377c1d..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf9280pdk/nrf9280/cpurad -name: nRF9280-DK-nRF9280-Radio -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -sysbuild: true -ram: 32 -flash: 256 -supported: - - counter - - gpio - - pwm - - spi diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad_defconfig b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad_defconfig deleted file mode 100644 index 27df01dee12..00000000000 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280_cpurad_defconfig +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2024 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 - -# 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 diff --git a/boards/nordic/nrf9280pdk/support/nrf9280_cpuapp.JLinkScript b/boards/nordic/nrf9280pdk/support/nrf9280_cpuapp.JLinkScript deleted file mode 100644 index ffa1beed1ed..00000000000 --- a/boards/nordic/nrf9280pdk/support/nrf9280_cpuapp.JLinkScript +++ /dev/null @@ -1,41 +0,0 @@ -// Debug Halting Control and Status Register -__constant U32 _DHCSR_ADDR = 0xE000EDF0; -__constant U32 _DHCSR_DBGKEY = (0xA05F << 16); -__constant U32 _DHCSR_C_DEBUGEN = (1 << 0); -__constant U32 _DHCSR_C_HALT = (1 << 1); - -// Debug Exception and Monitor Control Register -__constant U32 _DEMCR_ADDR = 0xE000EDFC; -__constant U32 _DEMCR_VC_CORERESET = (1 << 0); -__constant U32 _DEMCR_TRCENA = (1 << 24); - -// CPU wait enable register -__constant U32 _CPUCONF_CPUWAIT_ADDR = 0x5201150C; - -int ResetTarget(void) { - // ADAC reset - JLINK_CORESIGHT_WriteDP(2, 0x04000010); - JLINK_CORESIGHT_WriteAP(0, 0xA3030000); - JLINK_CORESIGHT_WriteAP(0, 0x00000004); - JLINK_CORESIGHT_WriteAP(0, 0x01020000); - - JLINK_SYS_Sleep(100); - JLINK_CORESIGHT_ReadAP(2); - JLINK_CORESIGHT_ReadAP(2); - JLINK_CORESIGHT_ReadAP(2); - JLINK_CORESIGHT_ReadAP(2); - - // Halt the CPU - JLINK_MEM_WriteU32(_DHCSR_ADDR, (_DHCSR_DBGKEY | _DHCSR_C_HALT | _DHCSR_C_DEBUGEN)); - - // Set vector catch on reset (to halt the CPU immediately after reset) - JLINK_MEM_WriteU32(_DEMCR_ADDR, (_DEMCR_VC_CORERESET | _DEMCR_TRCENA)); - - // Disable CPU wait - JLINK_MEM_WriteU32(_CPUCONF_CPUWAIT_ADDR, 0); - - // Clear vector catch stuff - JLINK_MEM_WriteU32(_DEMCR_ADDR, _DEMCR_TRCENA); - - return 0; -} diff --git a/boards/nordic/nrf9280pdk/support/nrf9280_cpurad.JLinkScript b/boards/nordic/nrf9280pdk/support/nrf9280_cpurad.JLinkScript deleted file mode 100644 index 2f1802801c1..00000000000 --- a/boards/nordic/nrf9280pdk/support/nrf9280_cpurad.JLinkScript +++ /dev/null @@ -1,48 +0,0 @@ -// Debug Halting Control and Status Register -__constant U32 _DHCSR_ADDR = 0xE000EDF0; -__constant U32 _DHCSR_DBGKEY = (0xA05F << 16); -__constant U32 _DHCSR_C_DEBUGEN = (1 << 0); -__constant U32 _DHCSR_C_HALT = (1 << 1); - -// Debug Exception and Monitor Control Register -__constant U32 _DEMCR_ADDR = 0xE000EDFC; -__constant U32 _DEMCR_VC_CORERESET = (1 << 0); -__constant U32 _DEMCR_TRCENA = (1 << 24); - -// CPU wait enable register -__constant U32 _CPUCONF_CPUWAIT_ADDR = 0x5301150C; - -int ConfigTargetSettings(void) { - JLINK_ExecCommand("CORESIGHT_AddAP = Index=1 Type=AHB-AP"); - CORESIGHT_IndexAHBAPToUse = 1; - - return 0; -} - -int ResetTarget(void) { - // ADAC reset - JLINK_CORESIGHT_WriteDP(2, 0x04000010); - JLINK_CORESIGHT_WriteAP(0, 0xA3030000); - JLINK_CORESIGHT_WriteAP(0, 0x00000004); - JLINK_CORESIGHT_WriteAP(0, 0x01030000); - - JLINK_SYS_Sleep(100); - JLINK_CORESIGHT_ReadAP(2); - JLINK_CORESIGHT_ReadAP(2); - JLINK_CORESIGHT_ReadAP(2); - JLINK_CORESIGHT_ReadAP(2); - - // Halt the CPU - JLINK_MEM_WriteU32(_DHCSR_ADDR, (_DHCSR_DBGKEY | _DHCSR_C_HALT | _DHCSR_C_DEBUGEN)); - - // Set vector catch on reset (to halt the CPU immediately after reset) - JLINK_MEM_WriteU32(_DEMCR_ADDR, (_DEMCR_VC_CORERESET | _DEMCR_TRCENA)); - - // Disable CPU wait - JLINK_MEM_WriteU32(_CPUCONF_CPUWAIT_ADDR, 0); - - // Clear vector catch stuff - JLINK_MEM_WriteU32(_DEMCR_ADDR, _DEMCR_TRCENA); - - return 0; -} From 0a4897897f7debebbe0ff4c7f66e66e5284c31ba Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 024/825] Revert "[nrf fromtree] scripts: west: runners: add initial nRF92 support" This reverts commit 4201dac65b8d49a4f4637dd17aeeabcd526ca554. --- scripts/west_commands/runners/nrf_common.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index b95dd4cf546..7b26885d1ef 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -70,7 +70,7 @@ def dev_id_help(cls) -> str: def do_add_parser(cls, parser): parser.add_argument('--nrf-family', choices=['NRF51', 'NRF52', 'NRF53', 'NRF54L', - 'NRF54H', 'NRF91', 'NRF92'], + 'NRF54H', 'NRF91'], help='''MCU family; still accepted for compatibility only''') parser.add_argument('--softreset', required=False, @@ -178,8 +178,6 @@ def ensure_family(self): self.family = 'NRF54H_FAMILY' elif self.build_conf.getboolean('CONFIG_SOC_SERIES_NRF91X'): self.family = 'NRF91_FAMILY' - elif self.build_conf.getboolean('CONFIG_SOC_SERIES_NRF92X'): - self.family = 'NRF92_FAMILY' else: raise RuntimeError(f'unknown nRF; update {__file__}') @@ -231,7 +229,7 @@ def flush(self, force=False): def recover_target(self): - if self.family in ('NRF53_FAMILY', 'NRF54H_FAMILY', 'NRF92_FAMILY'): + if self.family in ('NRF53_FAMILY', 'NRF54H_FAMILY'): self.logger.info( 'Recovering and erasing flash memory for both the network ' 'and application cores.') @@ -244,7 +242,7 @@ def recover_target(self): # keeps the debug access port open, recovering the network core last # would result in that small image being deleted from the app core. # In the case of the 54H, the order is indifferent. - if self.family in ('NRF53_FAMILY', 'NRF54H_FAMILY', 'NRF92_FAMILY'): + if self.family in ('NRF53_FAMILY', 'NRF54H_FAMILY'): self.exec_op('recover', core='NRFDL_DEVICE_CORE_NETWORK') self.exec_op('recover') @@ -256,12 +254,9 @@ def program_hex(self): # What type of erase/core arguments should we pass to the tool? core = None - if self.family in ('NRF54H_FAMILY', 'NRF92_FAMILY'): + if self.family == 'NRF54H_FAMILY': erase_arg = 'ERASE_NONE' - cpuapp = self.build_conf.getboolean('CONFIG_SOC_NRF54H20_CPUAPP') or self.build_conf.getboolean('CONFIG_SOC_NRF9280_CPUAPP') - cpurad = self.build_conf.getboolean('CONFIG_SOC_NRF54H20_CPURAD') or self.build_conf.getboolean('CONFIG_SOC_NRF9280_CPURAD') - if self.erase: self.exec_op('erase', core='NRFDL_DEVICE_CORE_APPLICATION') self.exec_op('erase', core='NRFDL_DEVICE_CORE_NETWORK') @@ -284,18 +279,18 @@ def program_hex(self): # Handle SUIT root manifest if application manifests are not used. # If an application firmware is built, the root envelope is merged with other application manifests # as well as the output HEX file. - if not cpuapp and self.sysbuild_conf.get('SB_CONFIG_SUIT_ENVELOPE'): + if not self.build_conf.getboolean('CONFIG_SOC_NRF54H20_CPUAPP') and self.sysbuild_conf.get('SB_CONFIG_SUIT_ENVELOPE'): app_root_envelope_hex_file = os.fspath( mpi_hex_dir / 'suit_installed_envelopes_application_merged.hex') self.op_program(app_root_envelope_hex_file, 'ERASE_NONE', None, defer=True, core='NRFDL_DEVICE_CORE_APPLICATION') - if cpuapp: + if self.build_conf.getboolean('CONFIG_SOC_NRF54H20_CPUAPP'): if not self.erase and self.build_conf.getboolean('CONFIG_NRF_REGTOOL_GENERATE_UICR'): self.exec_op('erase', core='NRFDL_DEVICE_CORE_APPLICATION', chip_erase_mode='ERASE_UICR', qspi_erase_mode='ERASE_NONE') core = 'NRFDL_DEVICE_CORE_APPLICATION' - elif cpurad: + elif self.build_conf.getboolean('CONFIG_SOC_NRF54H20_CPURAD'): if not self.erase and self.build_conf.getboolean('CONFIG_NRF_REGTOOL_GENERATE_UICR'): self.exec_op('erase', core='NRFDL_DEVICE_CORE_NETWORK', chip_erase_mode='ERASE_UICR', From fd7311dc811862d60a1a85bd45e6d152d6af2ee3 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 025/825] Revert "[nrf fromtree] drivers: serial: nrf: disable legacy shim for nRF92" This reverts commit b182ac5e30bf7ddd770c75af67502f8303caf68e. --- drivers/serial/Kconfig.nrfx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/serial/Kconfig.nrfx b/drivers/serial/Kconfig.nrfx index daf185cd7e8..930dd00e3d8 100644 --- a/drivers/serial/Kconfig.nrfx +++ b/drivers/serial/Kconfig.nrfx @@ -32,8 +32,7 @@ config UART_NRFX_UARTE_LEGACY_SHIM bool "Legacy UARTE shim" depends on UART_NRFX_UARTE depends on !SOC_SERIES_NRF54LX - depends on !SOC_SERIES_NRF54HX || RISCV - depends on !SOC_SERIES_NRF92X || RISCV + depends on RISCV || !SOC_SERIES_NRF54HX # New shim takes more ROM. Until it is fixed use legacy shim. default y From a255f704c11bcbce3ff91db651e294341b9c9d5f Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 026/825] Revert "[nrf noup] soc: nordic: ensure clean merge of initial nRF9280 SiP part2" This reverts commit ed9c711f2b349dea69cd5a08ea273d7fe827fad6. --- soc/nordic/Kconfig.defconfig | 2 +- soc/nordic/common/vpr/Kconfig.sysbuild | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/soc/nordic/Kconfig.defconfig b/soc/nordic/Kconfig.defconfig index b733eaeed03..0ac3c5ec3db 100644 --- a/soc/nordic/Kconfig.defconfig +++ b/soc/nordic/Kconfig.defconfig @@ -11,7 +11,7 @@ rsource "*/Kconfig.defconfig" if SYS_CLOCK_EXISTS config CLOCK_CONTROL - default y if !SOC_SERIES_NRF92X + default y if (!SOC_SERIES_NRF54HX && !SOC_SERIES_NRF92X) endif # SYS_CLOCK_EXISTS diff --git a/soc/nordic/common/vpr/Kconfig.sysbuild b/soc/nordic/common/vpr/Kconfig.sysbuild index 54464f10bc4..4fd5f259869 100644 --- a/soc/nordic/common/vpr/Kconfig.sysbuild +++ b/soc/nordic/common/vpr/Kconfig.sysbuild @@ -4,7 +4,7 @@ config VPR_LAUNCHER bool "VPR launcher" default y - depends on (SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR || SOC_NRF54L15_ENGA_CPUFLPR || SOC_NRF54L15_CPUFLPR || SOC_NRF9280_CPUPPR) + depends on (SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR || SOC_NRF54L15_ENGA_CPUFLPR || SOC_NRF9280_CPUPPR) help Include VPR launcher in build. VPR launcher is a minimal sample built for an ARM core that starts given VPR core. From 0f8e82f5d6c51be20e0d59a527f3b422d3af141e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 027/825] Revert "[nrf fromtree] soc: nordic: Add initial support for nRF9280 SiP" This reverts commit eb7c2942a6ba7923b28d93114313b91b1c60ffad. --- modules/hal_nordic/Kconfig.nrf_regtool | 2 +- modules/hal_nordic/nrfx/CMakeLists.txt | 11 - modules/hal_nordic/nrfx/nrfx_config.h | 6 - .../nrfx_config_nrf9230_engb_application.h | 1973 ---------------- .../nrfx/nrfx_config_nrf9230_engb_ppr.h | 1910 --------------- .../nrfx/nrfx_config_nrf9230_engb_radiocore.h | 2040 ----------------- soc/nordic/Kconfig | 1 - soc/nordic/Kconfig.defconfig | 2 +- soc/nordic/Kconfig.soc | 7 - soc/nordic/common/vpr/Kconfig.sysbuild | 2 +- soc/nordic/nrf92/CMakeLists.txt | 12 - soc/nordic/nrf92/Kconfig | 47 - soc/nordic/nrf92/Kconfig.defconfig | 41 - .../nrf92/Kconfig.defconfig.nrf9280_cpuapp | 14 - .../nrf92/Kconfig.defconfig.nrf9280_cpuppr | 12 - .../nrf92/Kconfig.defconfig.nrf9280_cpurad | 14 - soc/nordic/nrf92/Kconfig.soc | 66 - soc/nordic/nrf92/align.ld | 10 - soc/nordic/nrf92/soc.c | 114 - soc/nordic/nrf92/soc.h | 12 - soc/nordic/soc.yml | 19 - 21 files changed, 3 insertions(+), 6312 deletions(-) delete mode 100644 modules/hal_nordic/nrfx/nrfx_config_nrf9230_engb_application.h delete mode 100644 modules/hal_nordic/nrfx/nrfx_config_nrf9230_engb_ppr.h delete mode 100644 modules/hal_nordic/nrfx/nrfx_config_nrf9230_engb_radiocore.h delete mode 100644 soc/nordic/nrf92/CMakeLists.txt delete mode 100644 soc/nordic/nrf92/Kconfig delete mode 100644 soc/nordic/nrf92/Kconfig.defconfig delete mode 100644 soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp delete mode 100644 soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuppr delete mode 100644 soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad delete mode 100644 soc/nordic/nrf92/Kconfig.soc delete mode 100644 soc/nordic/nrf92/align.ld delete mode 100644 soc/nordic/nrf92/soc.c delete mode 100644 soc/nordic/nrf92/soc.h diff --git a/modules/hal_nordic/Kconfig.nrf_regtool b/modules/hal_nordic/Kconfig.nrf_regtool index 77944c5bb05..703d02f5605 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_NRF54HX || SOC_SERIES_NRF92X + depends on SOC_SERIES_NRF54HX config NRF_REGTOOL_GENERATE_UICR bool "Generate UICR" diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 2714d33f86a..caa3e85d142 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -53,13 +53,6 @@ zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54L15_CPUAPP NRF_APPLI zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9120 NRF9120_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9160 NRF9160_XXAA) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9230_ENGB_CPUAPP NRF9230_ENGB_XXAA - NRF_APPLICATION) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9230_ENGB_CPURAD NRF9230_ENGB_XXAA - NRF_RADIOCORE) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9230_ENGB_CPUPPR NRF9230_ENGB_XXAA - NRF_PPR) - zephyr_compile_definitions_ifdef(CONFIG_NRF_APPROTECT_LOCK ENABLE_APPROTECT) zephyr_compile_definitions_ifdef(CONFIG_NRF_APPROTECT_USER_HANDLING @@ -93,7 +86,6 @@ zephyr_library_sources_ifdef(CONFIG_SOC_NRF5340_CPUNET ${MDK_DIR}/system_nrf5340 zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_NRF54HX ${MDK_DIR}/system_nrf54h.c) zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_NRF54LX ${MDK_DIR}/system_nrf54l.c) zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_NRF91X ${MDK_DIR}/system_nrf91.c) -zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_NRF92X ${MDK_DIR}/system_nrf92.c) zephyr_library_sources(nrfx_glue.c) zephyr_library_sources(${HELPERS_DIR}/nrfx_flag32_allocator.c) @@ -225,6 +217,3 @@ 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_NRF9120 nrf9120.svd) mdk_svd_ifdef(CONFIG_SOC_NRF9160 nrf9160.svd) -mdk_svd_ifdef(CONFIG_SOC_NRF9230_ENGB_CPUAPP nrf9230_engb_application.svd) -mdk_svd_ifdef(CONFIG_SOC_NRF9230_ENGB_CPUPPR nrf9230_engb_ppr.svd) -mdk_svd_ifdef(CONFIG_SOC_NRF9230_ENGB_CPURAD nrf9230_engb_radiocore.svd) diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index 1e269c1aba8..c2e558ded24 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -1041,12 +1041,6 @@ #include #elif defined(NRF9120_XXAA) || defined(NRF9160_XXAA) #include -#elif defined(NRF9230_ENGB_XXAA) && defined(NRF_APPLICATION) - #include -#elif defined(NRF9230_ENGB_XXAA) && defined(NRF_RADIOCORE) - #include -#elif defined(NRF9230_ENGB_XXAA) && defined(NRF_PPR) - #include #else #include #endif diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf9230_engb_application.h b/modules/hal_nordic/nrfx/nrfx_config_nrf9230_engb_application.h deleted file mode 100644 index a7905c199d2..00000000000 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf9230_engb_application.h +++ /dev/null @@ -1,1973 +0,0 @@ -/* - * Copyright (c) 2024, Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef NRFX_CONFIG_NRF9230_ENGB_APPLICATION_H__ -#define NRFX_CONFIG_NRF9230_ENGB_APPLICATION_H__ - -#ifndef NRFX_CONFIG_H__ -#error "This file should not be included directly. Include nrfx_config.h instead." -#endif - - -/** - * @brief NRFX_DEFAULT_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_DEFAULT_IRQ_PRIORITY -#define NRFX_DEFAULT_IRQ_PRIORITY 7 -#endif - -/** - * @brief NRFX_BELLBOARD_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_BELLBOARD_ENABLED -#define NRFX_BELLBOARD_ENABLED 0 -#endif - -/** - * @brief NRFX_BELLBOARD_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_BELLBOARD_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_BELLBOARD_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_BELLBOARD0_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_BELLBOARD0_ENABLED -#define NRFX_BELLBOARD0_ENABLED 0 -#endif - -/** - * @brief NRFX_BELLBOARD1_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_BELLBOARD1_ENABLED -#define NRFX_BELLBOARD1_ENABLED 0 -#endif - -/** - * @brief NRFX_BELLBOARD2_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_BELLBOARD2_ENABLED -#define NRFX_BELLBOARD2_ENABLED 0 -#endif - -/** - * @brief NRFX_BELLBOARD3_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_BELLBOARD3_ENABLED -#define NRFX_BELLBOARD3_ENABLED 0 -#endif - -/** - * @brief NRFX_COMP_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_COMP_ENABLED -#define NRFX_COMP_ENABLED 0 -#endif - -/** - * @brief NRFX_COMP_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_COMP_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_COMP_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_COMP_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_COMP_CONFIG_LOG_ENABLED -#define NRFX_COMP_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_COMP_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_COMP_CONFIG_LOG_LEVEL -#define NRFX_COMP_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_DPPI_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_DPPI_ENABLED -#define NRFX_DPPI_ENABLED 0 -#endif - -/** - * @brief NRFX_DPPI_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_DPPI_CONFIG_LOG_ENABLED -#define NRFX_DPPI_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_DPPI_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_DPPI_CONFIG_LOG_LEVEL -#define NRFX_DPPI_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_DPPI120_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI120_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI120_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000f0 -#endif - -/** - * @brief NRFX_DPPI130_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI130_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI130_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000ff -#endif - -/** - * @brief NRFX_DPPI131_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI131_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI131_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_DPPI132_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI132_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI132_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_DPPI133_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI133_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI133_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x0000001e -#endif - -/** - * @brief NRFX_DPPI134_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI134_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI134_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000020 -#endif - -/** - * @brief NRFX_DPPI135_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI135_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI135_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000040 -#endif - -/** - * @brief NRFX_DPPI136_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI136_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI136_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000081 -#endif - -/** - * @brief NRFX_DPPI120_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI120_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI120_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x0000000f -#endif - -/** - * @brief NRFX_DPPI130_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI130_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI130_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000ff -#endif - -/** - * @brief NRFX_DPPI131_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI131_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI131_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000ff -#endif - -/** - * @brief NRFX_DPPI132_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI132_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI132_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_DPPI133_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI133_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI133_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000e1 -#endif - -/** - * @brief NRFX_DPPI134_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI134_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI134_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000df -#endif - -/** - * @brief NRFX_DPPI135_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI135_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI135_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000bf -#endif - -/** - * @brief NRFX_DPPI136_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI136_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI136_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x0000007e -#endif - -/** - * @brief NRFX_EGU_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_EGU_ENABLED -#define NRFX_EGU_ENABLED 0 -#endif - -/** - * @brief NRFX_EGU_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_EGU_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_EGU_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_EGU130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_EGU130_ENABLED -#define NRFX_EGU130_ENABLED 0 -#endif - -/** - * @brief NRFX_GPIOTE_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GPIOTE_ENABLED -#define NRFX_GPIOTE_ENABLED 0 -#endif - -/** - * @brief NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_GPIOTE_CONFIG_NUM_OF_EVT_HANDLERS - * - * Integer value. Minimum: 0. Maximum: 15. - */ -#ifndef NRFX_GPIOTE_CONFIG_NUM_OF_EVT_HANDLERS -#define NRFX_GPIOTE_CONFIG_NUM_OF_EVT_HANDLERS 2 -#endif - -/** - * @brief NRFX_GPIOTE_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GPIOTE_CONFIG_LOG_ENABLED -#define NRFX_GPIOTE_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_GPIOTE_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_GPIOTE_CONFIG_LOG_LEVEL -#define NRFX_GPIOTE_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_GPIOTE130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GPIOTE130_ENABLED -#define NRFX_GPIOTE130_ENABLED 0 -#endif - -/** - * @brief NRFX_GPIOTE131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GPIOTE131_ENABLED -#define NRFX_GPIOTE131_ENABLED 0 -#endif - -/** - * @brief NRFX_GRTC_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GRTC_ENABLED -#define NRFX_GRTC_ENABLED 0 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_SLEEP_ALLOWED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GRTC_CONFIG_SLEEP_ALLOWED -#define NRFX_GRTC_CONFIG_SLEEP_ALLOWED 0 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_AUTOEN - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GRTC_CONFIG_AUTOEN -#define NRFX_GRTC_CONFIG_AUTOEN 0 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_AUTOSTART - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GRTC_CONFIG_AUTOSTART -#define NRFX_GRTC_CONFIG_AUTOSTART 0 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS - * - * Integer value. - */ -#ifndef NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS -#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS 4 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK - */ -#ifndef NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK -#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK 0x000000f0 -#endif - -/** - * @brief NRFX_GRTC_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_GRTC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_GRTC_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_GRTC_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GRTC_CONFIG_LOG_ENABLED -#define NRFX_GRTC_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_GRTC_CONFIG_LOG_LEVEL -#define NRFX_GRTC_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_I2S_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_I2S_ENABLED -#define NRFX_I2S_ENABLED 0 -#endif - -/** - * @brief NRFX_I2S_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_I2S_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_I2S_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_I2S_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_I2S_CONFIG_LOG_ENABLED -#define NRFX_I2S_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_I2S_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_I2S_CONFIG_LOG_LEVEL -#define NRFX_I2S_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_I2S130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_I2S130_ENABLED -#define NRFX_I2S130_ENABLED 0 -#endif - -/** - * @brief NRFX_I2S131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_I2S131_ENABLED -#define NRFX_I2S131_ENABLED 0 -#endif - -/** - * @brief NRFX_IPCT_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000003 -#endif - -/** - * @brief NRFX_IPCT120_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT120_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT120_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_IPCT130_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT130_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT130_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x0000000c -#endif - -/** - * @brief NRFX_IPCT_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x0000000c -#endif - -/** - * @brief NRFX_IPCT120_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT120_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT120_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_IPCT130_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT130_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT130_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000003 -#endif - -/** - * @brief NRFX_LPCOMP_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_LPCOMP_ENABLED -#define NRFX_LPCOMP_ENABLED 0 -#endif - -/** - * @brief NRFX_LPCOMP_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_LPCOMP_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_LPCOMP_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_LPCOMP_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_LPCOMP_CONFIG_LOG_ENABLED -#define NRFX_LPCOMP_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_LPCOMP_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_LPCOMP_CONFIG_LOG_LEVEL -#define NRFX_LPCOMP_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_MVDMA_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_MVDMA_ENABLED -#define NRFX_MVDMA_ENABLED 0 -#endif - -/** - * @brief NRFX_MVDMA120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_MVDMA120_ENABLED -#define NRFX_MVDMA120_ENABLED 0 -#endif - -/** - * @brief NRFX_MVDMA121_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_MVDMA121_ENABLED -#define NRFX_MVDMA121_ENABLED 0 -#endif - -/** - * @brief NRFX_PDM_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PDM_ENABLED -#define NRFX_PDM_ENABLED 0 -#endif - -/** - * @brief NRFX_PDM_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_PDM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_PDM_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_PDM_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PDM_CONFIG_LOG_ENABLED -#define NRFX_PDM_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_PDM_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_PDM_CONFIG_LOG_LEVEL -#define NRFX_PDM_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_PRS_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_ENABLED -#define NRFX_PRS_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_CONFIG_LOG_ENABLED -#define NRFX_PRS_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_PRS_CONFIG_LOG_LEVEL -#define NRFX_PRS_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_PRS_BOX_0_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_0_ENABLED -#define NRFX_PRS_BOX_0_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_1_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_1_ENABLED -#define NRFX_PRS_BOX_1_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_2_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_2_ENABLED -#define NRFX_PRS_BOX_2_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_3_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_3_ENABLED -#define NRFX_PRS_BOX_3_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_4_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_4_ENABLED -#define NRFX_PRS_BOX_4_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_5_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_5_ENABLED -#define NRFX_PRS_BOX_5_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_6_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_6_ENABLED -#define NRFX_PRS_BOX_6_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_7_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_7_ENABLED -#define NRFX_PRS_BOX_7_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_8_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_8_ENABLED -#define NRFX_PRS_BOX_8_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_9_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_9_ENABLED -#define NRFX_PRS_BOX_9_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM_ENABLED -#define NRFX_PWM_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_PWM_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM_CONFIG_LOG_ENABLED -#define NRFX_PWM_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_PWM_CONFIG_LOG_LEVEL -#define NRFX_PWM_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_PWM120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM120_ENABLED -#define NRFX_PWM120_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM130_ENABLED -#define NRFX_PWM130_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM131_ENABLED -#define NRFX_PWM131_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM132_ENABLED -#define NRFX_PWM132_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM133_ENABLED -#define NRFX_PWM133_ENABLED 0 -#endif - -/** - * @brief NRFX_QDEC_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_QDEC_ENABLED -#define NRFX_QDEC_ENABLED 0 -#endif - -/** - * @brief NRFX_QDEC_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_QDEC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_QDEC_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_QDEC_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_QDEC_CONFIG_LOG_ENABLED -#define NRFX_QDEC_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_QDEC_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_QDEC_CONFIG_LOG_LEVEL -#define NRFX_QDEC_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_QDEC130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_QDEC130_ENABLED -#define NRFX_QDEC130_ENABLED 0 -#endif - -/** - * @brief NRFX_QDEC131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_QDEC131_ENABLED -#define NRFX_QDEC131_ENABLED 0 -#endif - -/** - * @brief NRFX_RTC_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_RTC_ENABLED -#define NRFX_RTC_ENABLED 0 -#endif - -/** - * @brief NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_RTC_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_RTC_CONFIG_LOG_ENABLED -#define NRFX_RTC_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_RTC_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_RTC_CONFIG_LOG_LEVEL -#define NRFX_RTC_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_RTC130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_RTC130_ENABLED -#define NRFX_RTC130_ENABLED 0 -#endif - -/** - * @brief NRFX_RTC131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_RTC131_ENABLED -#define NRFX_RTC131_ENABLED 0 -#endif - -/** - * @brief NRFX_SAADC_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SAADC_ENABLED -#define NRFX_SAADC_ENABLED 0 -#endif - -/** - * @brief NRFX_SAADC_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_SAADC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SAADC_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_SAADC_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SAADC_CONFIG_LOG_ENABLED -#define NRFX_SAADC_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_SAADC_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_SAADC_CONFIG_LOG_LEVEL -#define NRFX_SAADC_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_SPIM_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM_ENABLED -#define NRFX_SPIM_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_SPIM_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM_CONFIG_LOG_ENABLED -#define NRFX_SPIM_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_SPIM_CONFIG_LOG_LEVEL -#define NRFX_SPIM_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_SPIM120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM120_ENABLED -#define NRFX_SPIM120_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM121_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM121_ENABLED -#define NRFX_SPIM121_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM130_ENABLED -#define NRFX_SPIM130_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM131_ENABLED -#define NRFX_SPIM131_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM132_ENABLED -#define NRFX_SPIM132_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM133_ENABLED -#define NRFX_SPIM133_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM134_ENABLED -#define NRFX_SPIM134_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM135_ENABLED -#define NRFX_SPIM135_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM136_ENABLED -#define NRFX_SPIM136_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM137_ENABLED -#define NRFX_SPIM137_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS_ENABLED -#define NRFX_SPIS_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_SPIS_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS_CONFIG_LOG_ENABLED -#define NRFX_SPIS_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_SPIS_CONFIG_LOG_LEVEL -#define NRFX_SPIS_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_SPIS120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS120_ENABLED -#define NRFX_SPIS120_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS130_ENABLED -#define NRFX_SPIS130_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS131_ENABLED -#define NRFX_SPIS131_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS132_ENABLED -#define NRFX_SPIS132_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS133_ENABLED -#define NRFX_SPIS133_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS134_ENABLED -#define NRFX_SPIS134_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS135_ENABLED -#define NRFX_SPIS135_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS136_ENABLED -#define NRFX_SPIS136_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS137_ENABLED -#define NRFX_SPIS137_ENABLED 0 -#endif - -/** - * @brief NRFX_SYSTICK_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SYSTICK_ENABLED -#define NRFX_SYSTICK_ENABLED 0 -#endif - -/** - * @brief NRFX_TEMP_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TEMP_ENABLED -#define NRFX_TEMP_ENABLED 0 -#endif - -/** - * @brief NRFX_TEMP_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_TEMP_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TEMP_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_TEMP_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TEMP_CONFIG_LOG_ENABLED -#define NRFX_TEMP_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_TEMP_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_TEMP_CONFIG_LOG_LEVEL -#define NRFX_TEMP_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_TIMER_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER_ENABLED -#define NRFX_TIMER_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_TIMER_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER_CONFIG_LOG_ENABLED -#define NRFX_TIMER_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_TIMER_CONFIG_LOG_LEVEL -#define NRFX_TIMER_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_TIMER120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER120_ENABLED -#define NRFX_TIMER120_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER121_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER121_ENABLED -#define NRFX_TIMER121_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER130_ENABLED -#define NRFX_TIMER130_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER131_ENABLED -#define NRFX_TIMER131_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER132_ENABLED -#define NRFX_TIMER132_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER133_ENABLED -#define NRFX_TIMER133_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER134_ENABLED -#define NRFX_TIMER134_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER135_ENABLED -#define NRFX_TIMER135_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER136_ENABLED -#define NRFX_TIMER136_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER137_ENABLED -#define NRFX_TIMER137_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM_ENABLED -#define NRFX_TWIM_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_TWIM_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM_CONFIG_LOG_ENABLED -#define NRFX_TWIM_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_TWIM_CONFIG_LOG_LEVEL -#define NRFX_TWIM_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_TWIM130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM130_ENABLED -#define NRFX_TWIM130_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM131_ENABLED -#define NRFX_TWIM131_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM132_ENABLED -#define NRFX_TWIM132_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM133_ENABLED -#define NRFX_TWIM133_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM134_ENABLED -#define NRFX_TWIM134_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM135_ENABLED -#define NRFX_TWIM135_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM136_ENABLED -#define NRFX_TWIM136_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM137_ENABLED -#define NRFX_TWIM137_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS_ENABLED -#define NRFX_TWIS_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_TWIS_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS_CONFIG_LOG_ENABLED -#define NRFX_TWIS_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY - * - * Assume that any instance would be initialized only once. - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY -#define NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY 0 -#endif - -/** - * @brief NRFX_TWIS_NO_SYNC_MODE - Remove support for synchronous mode. - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS_NO_SYNC_MODE -#define NRFX_TWIS_NO_SYNC_MODE 0 -#endif - -/** - * @brief NRFX_TWIS_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_TWIS_CONFIG_LOG_LEVEL -#define NRFX_TWIS_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_TWIS130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS130_ENABLED -#define NRFX_TWIS130_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS131_ENABLED -#define NRFX_TWIS131_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS132_ENABLED -#define NRFX_TWIS132_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS133_ENABLED -#define NRFX_TWIS133_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS134_ENABLED -#define NRFX_TWIS134_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS135_ENABLED -#define NRFX_TWIS135_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS136_ENABLED -#define NRFX_TWIS136_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS137_ENABLED -#define NRFX_TWIS137_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_ENABLED -#define NRFX_UARTE_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG - * - * If enabled, support for configuring GPIO pins is removed from the driver. - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG -#define NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG 0 -#endif - -/** - * @brief NRFX_UARTE_CONFIG_SKIP_PSEL_CONFIG - * - * If enabled, support for configuring PSEL registers is removed from the driver. - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_CONFIG_SKIP_PSEL_CONFIG -#define NRFX_UARTE_CONFIG_SKIP_PSEL_CONFIG 0 -#endif - -/** - * @brief NRFX_UARTE_CONFIG_TX_LINK - If enabled, driver supports linking of TX transfers. - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_CONFIG_TX_LINK -#define NRFX_UARTE_CONFIG_TX_LINK 1 -#endif - -/** - * @brief NRFX_UARTE_CONFIG_RX_CACHE_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_CONFIG_RX_CACHE_ENABLED -#define NRFX_UARTE_CONFIG_RX_CACHE_ENABLED 1 -#endif - -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - -/** - * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_UARTE_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_CONFIG_LOG_ENABLED -#define NRFX_UARTE_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_UARTE_CONFIG_LOG_LEVEL -#define NRFX_UARTE_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_UARTE120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE120_ENABLED -#define NRFX_UARTE120_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE130_ENABLED -#define NRFX_UARTE130_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE131_ENABLED -#define NRFX_UARTE131_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE132_ENABLED -#define NRFX_UARTE132_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE133_ENABLED -#define NRFX_UARTE133_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE134_ENABLED -#define NRFX_UARTE134_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE135_ENABLED -#define NRFX_UARTE135_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE136_ENABLED -#define NRFX_UARTE136_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE137_ENABLED -#define NRFX_UARTE137_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT_ENABLED -#define NRFX_WDT_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_WDT_CONFIG_NO_IRQ - Remove WDT IRQ handling from WDT driver - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT_CONFIG_NO_IRQ -#define NRFX_WDT_CONFIG_NO_IRQ 0 -#endif - -/** - * @brief NRFX_WDT_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT_CONFIG_LOG_ENABLED -#define NRFX_WDT_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_WDT_CONFIG_LOG_LEVEL -#define NRFX_WDT_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_WDT010_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT010_ENABLED -#define NRFX_WDT010_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT011_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT011_ENABLED -#define NRFX_WDT011_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT131_ENABLED -#define NRFX_WDT131_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT132_ENABLED -#define NRFX_WDT132_ENABLED 0 -#endif - -#endif /* NRFX_CONFIG_NRF9230_ENGB_APPLICATION_H__ */ diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf9230_engb_ppr.h b/modules/hal_nordic/nrfx/nrfx_config_nrf9230_engb_ppr.h deleted file mode 100644 index ae1f931e3da..00000000000 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf9230_engb_ppr.h +++ /dev/null @@ -1,1910 +0,0 @@ -/* - * Copyright (c) 2024, Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef NRFX_CONFIG_NRF9230_ENGB_PPR_H__ -#define NRFX_CONFIG_NRF9230_ENGB_PPR_H__ - -#ifndef NRFX_CONFIG_H__ -#error "This file should not be included directly. Include nrfx_config.h instead." -#endif - - -/** - * @brief NRFX_DEFAULT_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_DEFAULT_IRQ_PRIORITY -#define NRFX_DEFAULT_IRQ_PRIORITY 0 -#endif - -/** - * @brief NRFX_COMP_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_COMP_ENABLED -#define NRFX_COMP_ENABLED 0 -#endif - -/** - * @brief NRFX_COMP_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_COMP_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_COMP_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_COMP_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_COMP_CONFIG_LOG_ENABLED -#define NRFX_COMP_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_COMP_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_COMP_CONFIG_LOG_LEVEL -#define NRFX_COMP_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_COREDEP_VPR_LEGACY - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_COREDEP_VPR_LEGACY -#define NRFX_COREDEP_VPR_LEGACY 0 -#endif - -/** - * @brief NRFX_DPPI_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_DPPI_ENABLED -#define NRFX_DPPI_ENABLED 0 -#endif - -/** - * @brief NRFX_DPPI_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_DPPI_CONFIG_LOG_ENABLED -#define NRFX_DPPI_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_DPPI_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_DPPI_CONFIG_LOG_LEVEL -#define NRFX_DPPI_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_DPPI120_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI120_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI120_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000030 -#endif - -/** - * @brief NRFX_DPPI130_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI130_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI130_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000ff -#endif - -/** - * @brief NRFX_DPPI131_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI131_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI131_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_DPPI132_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI132_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI132_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_DPPI133_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI133_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI133_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x0000001e -#endif - -/** - * @brief NRFX_DPPI134_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI134_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI134_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000020 -#endif - -/** - * @brief NRFX_DPPI135_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI135_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI135_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000040 -#endif - -/** - * @brief NRFX_DPPI136_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI136_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI136_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000081 -#endif - -/** - * @brief NRFX_DPPI120_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI120_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI120_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x0000000c -#endif - -/** - * @brief NRFX_DPPI130_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI130_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI130_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000ff -#endif - -/** - * @brief NRFX_DPPI131_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI131_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI131_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000ff -#endif - -/** - * @brief NRFX_DPPI132_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI132_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI132_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_DPPI133_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI133_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI133_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000e1 -#endif - -/** - * @brief NRFX_DPPI134_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI134_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI134_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000df -#endif - -/** - * @brief NRFX_DPPI135_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI135_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI135_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000bf -#endif - -/** - * @brief NRFX_DPPI136_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI136_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI136_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x0000007e -#endif - -/** - * @brief NRFX_EGU_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_EGU_ENABLED -#define NRFX_EGU_ENABLED 0 -#endif - -/** - * @brief NRFX_EGU_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_EGU_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_EGU_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_EGU130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_EGU130_ENABLED -#define NRFX_EGU130_ENABLED 0 -#endif - -/** - * @brief NRFX_GPIOTE_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GPIOTE_ENABLED -#define NRFX_GPIOTE_ENABLED 0 -#endif - -/** - * @brief NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_GPIOTE_CONFIG_NUM_OF_EVT_HANDLERS - * - * Integer value. Minimum: 0. Maximum: 15. - */ -#ifndef NRFX_GPIOTE_CONFIG_NUM_OF_EVT_HANDLERS -#define NRFX_GPIOTE_CONFIG_NUM_OF_EVT_HANDLERS 2 -#endif - -/** - * @brief NRFX_GPIOTE_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GPIOTE_CONFIG_LOG_ENABLED -#define NRFX_GPIOTE_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_GPIOTE_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_GPIOTE_CONFIG_LOG_LEVEL -#define NRFX_GPIOTE_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_GPIOTE130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GPIOTE130_ENABLED -#define NRFX_GPIOTE130_ENABLED 0 -#endif - -/** - * @brief NRFX_GPIOTE131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GPIOTE131_ENABLED -#define NRFX_GPIOTE131_ENABLED 0 -#endif - -/** - * @brief NRFX_GRTC_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GRTC_ENABLED -#define NRFX_GRTC_ENABLED 0 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_SLEEP_ALLOWED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GRTC_CONFIG_SLEEP_ALLOWED -#define NRFX_GRTC_CONFIG_SLEEP_ALLOWED 0 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_AUTOEN - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GRTC_CONFIG_AUTOEN -#define NRFX_GRTC_CONFIG_AUTOEN 0 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_AUTOSTART - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GRTC_CONFIG_AUTOSTART -#define NRFX_GRTC_CONFIG_AUTOSTART 0 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS - * - * Integer value. - */ -#ifndef NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS -#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS 2 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK - */ -#ifndef NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK -#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK 0x000000c0 -#endif - -/** - * @brief NRFX_GRTC_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_GRTC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_GRTC_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_GRTC_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GRTC_CONFIG_LOG_ENABLED -#define NRFX_GRTC_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_GRTC_CONFIG_LOG_LEVEL -#define NRFX_GRTC_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_I2S_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_I2S_ENABLED -#define NRFX_I2S_ENABLED 0 -#endif - -/** - * @brief NRFX_I2S_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_I2S_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_I2S_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_I2S_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_I2S_CONFIG_LOG_ENABLED -#define NRFX_I2S_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_I2S_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_I2S_CONFIG_LOG_LEVEL -#define NRFX_I2S_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_I2S130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_I2S130_ENABLED -#define NRFX_I2S130_ENABLED 0 -#endif - -/** - * @brief NRFX_I2S131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_I2S131_ENABLED -#define NRFX_I2S131_ENABLED 0 -#endif - -/** - * @brief NRFX_IPCT_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_IPCT120_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT120_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT120_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_IPCT130_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT130_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT130_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x0000000c -#endif - -/** - * @brief NRFX_IPCT_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_IPCT120_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT120_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT120_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_IPCT130_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT130_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT130_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000003 -#endif - -/** - * @brief NRFX_LPCOMP_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_LPCOMP_ENABLED -#define NRFX_LPCOMP_ENABLED 0 -#endif - -/** - * @brief NRFX_LPCOMP_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_LPCOMP_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_LPCOMP_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_LPCOMP_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_LPCOMP_CONFIG_LOG_ENABLED -#define NRFX_LPCOMP_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_LPCOMP_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_LPCOMP_CONFIG_LOG_LEVEL -#define NRFX_LPCOMP_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_MVDMA_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_MVDMA_ENABLED -#define NRFX_MVDMA_ENABLED 0 -#endif - -/** - * @brief NRFX_MVDMA120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_MVDMA120_ENABLED -#define NRFX_MVDMA120_ENABLED 0 -#endif - -/** - * @brief NRFX_MVDMA121_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_MVDMA121_ENABLED -#define NRFX_MVDMA121_ENABLED 0 -#endif - -/** - * @brief NRFX_PDM_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PDM_ENABLED -#define NRFX_PDM_ENABLED 0 -#endif - -/** - * @brief NRFX_PDM_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_PDM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_PDM_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_PDM_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PDM_CONFIG_LOG_ENABLED -#define NRFX_PDM_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_PDM_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_PDM_CONFIG_LOG_LEVEL -#define NRFX_PDM_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_PRS_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_ENABLED -#define NRFX_PRS_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_CONFIG_LOG_ENABLED -#define NRFX_PRS_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_PRS_CONFIG_LOG_LEVEL -#define NRFX_PRS_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_PRS_BOX_0_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_0_ENABLED -#define NRFX_PRS_BOX_0_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_1_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_1_ENABLED -#define NRFX_PRS_BOX_1_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_2_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_2_ENABLED -#define NRFX_PRS_BOX_2_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_3_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_3_ENABLED -#define NRFX_PRS_BOX_3_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_4_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_4_ENABLED -#define NRFX_PRS_BOX_4_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_5_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_5_ENABLED -#define NRFX_PRS_BOX_5_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_6_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_6_ENABLED -#define NRFX_PRS_BOX_6_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_7_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_7_ENABLED -#define NRFX_PRS_BOX_7_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_8_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_8_ENABLED -#define NRFX_PRS_BOX_8_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_9_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_9_ENABLED -#define NRFX_PRS_BOX_9_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM_ENABLED -#define NRFX_PWM_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_PWM_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM_CONFIG_LOG_ENABLED -#define NRFX_PWM_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_PWM_CONFIG_LOG_LEVEL -#define NRFX_PWM_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_PWM120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM120_ENABLED -#define NRFX_PWM120_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM130_ENABLED -#define NRFX_PWM130_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM131_ENABLED -#define NRFX_PWM131_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM132_ENABLED -#define NRFX_PWM132_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM133_ENABLED -#define NRFX_PWM133_ENABLED 0 -#endif - -/** - * @brief NRFX_QDEC_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_QDEC_ENABLED -#define NRFX_QDEC_ENABLED 0 -#endif - -/** - * @brief NRFX_QDEC_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_QDEC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_QDEC_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_QDEC_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_QDEC_CONFIG_LOG_ENABLED -#define NRFX_QDEC_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_QDEC_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_QDEC_CONFIG_LOG_LEVEL -#define NRFX_QDEC_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_QDEC130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_QDEC130_ENABLED -#define NRFX_QDEC130_ENABLED 0 -#endif - -/** - * @brief NRFX_QDEC131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_QDEC131_ENABLED -#define NRFX_QDEC131_ENABLED 0 -#endif - -/** - * @brief NRFX_RTC_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_RTC_ENABLED -#define NRFX_RTC_ENABLED 0 -#endif - -/** - * @brief NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_RTC_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_RTC_CONFIG_LOG_ENABLED -#define NRFX_RTC_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_RTC_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_RTC_CONFIG_LOG_LEVEL -#define NRFX_RTC_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_RTC130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_RTC130_ENABLED -#define NRFX_RTC130_ENABLED 0 -#endif - -/** - * @brief NRFX_RTC131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_RTC131_ENABLED -#define NRFX_RTC131_ENABLED 0 -#endif - -/** - * @brief NRFX_SAADC_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SAADC_ENABLED -#define NRFX_SAADC_ENABLED 0 -#endif - -/** - * @brief NRFX_SAADC_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_SAADC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SAADC_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_SAADC_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SAADC_CONFIG_LOG_ENABLED -#define NRFX_SAADC_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_SAADC_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_SAADC_CONFIG_LOG_LEVEL -#define NRFX_SAADC_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_SPIM_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM_ENABLED -#define NRFX_SPIM_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_SPIM_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM_CONFIG_LOG_ENABLED -#define NRFX_SPIM_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_SPIM_CONFIG_LOG_LEVEL -#define NRFX_SPIM_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_SPIM120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM120_ENABLED -#define NRFX_SPIM120_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM121_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM121_ENABLED -#define NRFX_SPIM121_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM130_ENABLED -#define NRFX_SPIM130_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM131_ENABLED -#define NRFX_SPIM131_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM132_ENABLED -#define NRFX_SPIM132_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM133_ENABLED -#define NRFX_SPIM133_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM134_ENABLED -#define NRFX_SPIM134_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM135_ENABLED -#define NRFX_SPIM135_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM136_ENABLED -#define NRFX_SPIM136_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM137_ENABLED -#define NRFX_SPIM137_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS_ENABLED -#define NRFX_SPIS_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_SPIS_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS_CONFIG_LOG_ENABLED -#define NRFX_SPIS_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_SPIS_CONFIG_LOG_LEVEL -#define NRFX_SPIS_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_SPIS120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS120_ENABLED -#define NRFX_SPIS120_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS130_ENABLED -#define NRFX_SPIS130_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS131_ENABLED -#define NRFX_SPIS131_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS132_ENABLED -#define NRFX_SPIS132_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS133_ENABLED -#define NRFX_SPIS133_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS134_ENABLED -#define NRFX_SPIS134_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS135_ENABLED -#define NRFX_SPIS135_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS136_ENABLED -#define NRFX_SPIS136_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS137_ENABLED -#define NRFX_SPIS137_ENABLED 0 -#endif - -/** - * @brief NRFX_TEMP_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TEMP_ENABLED -#define NRFX_TEMP_ENABLED 0 -#endif - -/** - * @brief NRFX_TEMP_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_TEMP_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TEMP_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_TEMP_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TEMP_CONFIG_LOG_ENABLED -#define NRFX_TEMP_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_TEMP_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_TEMP_CONFIG_LOG_LEVEL -#define NRFX_TEMP_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_TIMER_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER_ENABLED -#define NRFX_TIMER_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_TIMER_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER_CONFIG_LOG_ENABLED -#define NRFX_TIMER_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_TIMER_CONFIG_LOG_LEVEL -#define NRFX_TIMER_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_TIMER120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER120_ENABLED -#define NRFX_TIMER120_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER121_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER121_ENABLED -#define NRFX_TIMER121_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER130_ENABLED -#define NRFX_TIMER130_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER131_ENABLED -#define NRFX_TIMER131_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER132_ENABLED -#define NRFX_TIMER132_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER133_ENABLED -#define NRFX_TIMER133_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER134_ENABLED -#define NRFX_TIMER134_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER135_ENABLED -#define NRFX_TIMER135_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER136_ENABLED -#define NRFX_TIMER136_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER137_ENABLED -#define NRFX_TIMER137_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM_ENABLED -#define NRFX_TWIM_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_TWIM_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM_CONFIG_LOG_ENABLED -#define NRFX_TWIM_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_TWIM_CONFIG_LOG_LEVEL -#define NRFX_TWIM_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_TWIM130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM130_ENABLED -#define NRFX_TWIM130_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM131_ENABLED -#define NRFX_TWIM131_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM132_ENABLED -#define NRFX_TWIM132_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM133_ENABLED -#define NRFX_TWIM133_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM134_ENABLED -#define NRFX_TWIM134_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM135_ENABLED -#define NRFX_TWIM135_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM136_ENABLED -#define NRFX_TWIM136_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM137_ENABLED -#define NRFX_TWIM137_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS_ENABLED -#define NRFX_TWIS_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_TWIS_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS_CONFIG_LOG_ENABLED -#define NRFX_TWIS_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY - * - * Assume that any instance would be initialized only once. - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY -#define NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY 0 -#endif - -/** - * @brief NRFX_TWIS_NO_SYNC_MODE - Remove support for synchronous mode. - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS_NO_SYNC_MODE -#define NRFX_TWIS_NO_SYNC_MODE 0 -#endif - -/** - * @brief NRFX_TWIS_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_TWIS_CONFIG_LOG_LEVEL -#define NRFX_TWIS_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_TWIS130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS130_ENABLED -#define NRFX_TWIS130_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS131_ENABLED -#define NRFX_TWIS131_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS132_ENABLED -#define NRFX_TWIS132_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS133_ENABLED -#define NRFX_TWIS133_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS134_ENABLED -#define NRFX_TWIS134_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS135_ENABLED -#define NRFX_TWIS135_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS136_ENABLED -#define NRFX_TWIS136_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS137_ENABLED -#define NRFX_TWIS137_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_ENABLED -#define NRFX_UARTE_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG - * - * If enabled, support for configuring GPIO pins is removed from the driver. - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG -#define NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG 0 -#endif - -/** - * @brief NRFX_UARTE_CONFIG_SKIP_PSEL_CONFIG - * - * If enabled, support for configuring PSEL registers is removed from the driver. - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_CONFIG_SKIP_PSEL_CONFIG -#define NRFX_UARTE_CONFIG_SKIP_PSEL_CONFIG 0 -#endif - -/** - * @brief NRFX_UARTE_CONFIG_TX_LINK - If enabled, driver supports linking of TX transfers. - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_CONFIG_TX_LINK -#define NRFX_UARTE_CONFIG_TX_LINK 1 -#endif - -/** - * @brief NRFX_UARTE_CONFIG_RX_CACHE_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_CONFIG_RX_CACHE_ENABLED -#define NRFX_UARTE_CONFIG_RX_CACHE_ENABLED 1 -#endif - -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - -/** - * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_UARTE_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_CONFIG_LOG_ENABLED -#define NRFX_UARTE_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_UARTE_CONFIG_LOG_LEVEL -#define NRFX_UARTE_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_UARTE120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE120_ENABLED -#define NRFX_UARTE120_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE130_ENABLED -#define NRFX_UARTE130_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE131_ENABLED -#define NRFX_UARTE131_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE132_ENABLED -#define NRFX_UARTE132_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE133_ENABLED -#define NRFX_UARTE133_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE134_ENABLED -#define NRFX_UARTE134_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE135_ENABLED -#define NRFX_UARTE135_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE136_ENABLED -#define NRFX_UARTE136_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE137_ENABLED -#define NRFX_UARTE137_ENABLED 0 -#endif - -/** - * @brief NRFX_VEVIF_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_VEVIF_ENABLED -#define NRFX_VEVIF_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT_ENABLED -#define NRFX_WDT_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 3. - */ -#ifndef NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_WDT_CONFIG_NO_IRQ - Remove WDT IRQ handling from WDT driver - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT_CONFIG_NO_IRQ -#define NRFX_WDT_CONFIG_NO_IRQ 0 -#endif - -/** - * @brief NRFX_WDT_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT_CONFIG_LOG_ENABLED -#define NRFX_WDT_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_WDT_CONFIG_LOG_LEVEL -#define NRFX_WDT_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_WDT131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT131_ENABLED -#define NRFX_WDT131_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT132_ENABLED -#define NRFX_WDT132_ENABLED 0 -#endif - -#endif /* NRFX_CONFIG_NRF9230_ENGB_PPR_H__ */ diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf9230_engb_radiocore.h b/modules/hal_nordic/nrfx/nrfx_config_nrf9230_engb_radiocore.h deleted file mode 100644 index 84a0a7558e6..00000000000 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf9230_engb_radiocore.h +++ /dev/null @@ -1,2040 +0,0 @@ -/* - * Copyright (c) 2024, Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef NRFX_CONFIG_NRF9230_ENGB_RADIOCORE_H__ -#define NRFX_CONFIG_NRF9230_ENGB_RADIOCORE_H__ - -#ifndef NRFX_CONFIG_H__ -#error "This file should not be included directly. Include nrfx_config.h instead." -#endif - -#ifndef NRFX_RTC0_ENABLED -#define NRFX_RTC0_ENABLED 1 -#endif - -/** - * @brief NRFX_DEFAULT_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_DEFAULT_IRQ_PRIORITY -#define NRFX_DEFAULT_IRQ_PRIORITY 7 -#endif - -/** - * @brief NRFX_BELLBOARD_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_BELLBOARD_ENABLED -#define NRFX_BELLBOARD_ENABLED 0 -#endif - -/** - * @brief NRFX_BELLBOARD_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_BELLBOARD_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_BELLBOARD_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_BELLBOARD0_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_BELLBOARD0_ENABLED -#define NRFX_BELLBOARD0_ENABLED 0 -#endif - -/** - * @brief NRFX_BELLBOARD1_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_BELLBOARD1_ENABLED -#define NRFX_BELLBOARD1_ENABLED 0 -#endif - -/** - * @brief NRFX_BELLBOARD2_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_BELLBOARD2_ENABLED -#define NRFX_BELLBOARD2_ENABLED 0 -#endif - -/** - * @brief NRFX_BELLBOARD3_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_BELLBOARD3_ENABLED -#define NRFX_BELLBOARD3_ENABLED 0 -#endif - -/** - * @brief NRFX_COMP_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_COMP_ENABLED -#define NRFX_COMP_ENABLED 0 -#endif - -/** - * @brief NRFX_COMP_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_COMP_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_COMP_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_COMP_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_COMP_CONFIG_LOG_ENABLED -#define NRFX_COMP_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_COMP_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_COMP_CONFIG_LOG_LEVEL -#define NRFX_COMP_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_DPPI_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_DPPI_ENABLED -#define NRFX_DPPI_ENABLED 0 -#endif - -/** - * @brief NRFX_DPPI_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_DPPI_CONFIG_LOG_ENABLED -#define NRFX_DPPI_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_DPPI_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_DPPI_CONFIG_LOG_LEVEL -#define NRFX_DPPI_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_DPPI020_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI020_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI020_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000003 -#endif - -/** - * @brief NRFX_DPPI030_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI030_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI030_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000003 -#endif - -/** - * @brief NRFX_DPPI120_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI120_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI120_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000f0 -#endif - -/** - * @brief NRFX_DPPI130_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI130_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI130_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000ff -#endif - -/** - * @brief NRFX_DPPI131_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI131_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI131_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_DPPI132_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI132_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI132_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_DPPI133_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI133_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI133_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x0000001e -#endif - -/** - * @brief NRFX_DPPI134_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI134_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI134_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000020 -#endif - -/** - * @brief NRFX_DPPI135_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI135_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI135_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000040 -#endif - -/** - * @brief NRFX_DPPI136_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI136_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI136_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000081 -#endif - -/** - * @brief NRFX_DPPI020_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI020_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI020_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x0000000c -#endif - -/** - * @brief NRFX_DPPI030_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI030_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI030_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x0000000c -#endif - -/** - * @brief NRFX_DPPI120_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI120_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI120_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x0000000f -#endif - -/** - * @brief NRFX_DPPI130_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI130_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI130_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000ff -#endif - -/** - * @brief NRFX_DPPI131_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI131_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI131_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000ff -#endif - -/** - * @brief NRFX_DPPI132_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI132_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI132_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_DPPI133_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI133_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI133_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000e1 -#endif - -/** - * @brief NRFX_DPPI134_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI134_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI134_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000df -#endif - -/** - * @brief NRFX_DPPI135_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI135_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI135_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000bf -#endif - -/** - * @brief NRFX_DPPI136_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_DPPI136_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_DPPI136_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x0000007e -#endif - -/** - * @brief NRFX_EGU_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_EGU_ENABLED -#define NRFX_EGU_ENABLED 0 -#endif - -/** - * @brief NRFX_EGU_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_EGU_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_EGU_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_EGU020_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_EGU020_ENABLED -#define NRFX_EGU020_ENABLED 0 -#endif - -/** - * @brief NRFX_EGU130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_EGU130_ENABLED -#define NRFX_EGU130_ENABLED 0 -#endif - -/** - * @brief NRFX_GPIOTE_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GPIOTE_ENABLED -#define NRFX_GPIOTE_ENABLED 0 -#endif - -/** - * @brief NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_GPIOTE_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_GPIOTE_CONFIG_NUM_OF_EVT_HANDLERS - * - * Integer value. Minimum: 0. Maximum: 15. - */ -#ifndef NRFX_GPIOTE_CONFIG_NUM_OF_EVT_HANDLERS -#define NRFX_GPIOTE_CONFIG_NUM_OF_EVT_HANDLERS 2 -#endif - -/** - * @brief NRFX_GPIOTE_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GPIOTE_CONFIG_LOG_ENABLED -#define NRFX_GPIOTE_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_GPIOTE_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_GPIOTE_CONFIG_LOG_LEVEL -#define NRFX_GPIOTE_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_GPIOTE130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GPIOTE130_ENABLED -#define NRFX_GPIOTE130_ENABLED 0 -#endif - -/** - * @brief NRFX_GPIOTE131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GPIOTE131_ENABLED -#define NRFX_GPIOTE131_ENABLED 0 -#endif - -/** - * @brief NRFX_GRTC_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GRTC_ENABLED -#define NRFX_GRTC_ENABLED 0 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_SLEEP_ALLOWED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GRTC_CONFIG_SLEEP_ALLOWED -#define NRFX_GRTC_CONFIG_SLEEP_ALLOWED 0 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_AUTOEN - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GRTC_CONFIG_AUTOEN -#define NRFX_GRTC_CONFIG_AUTOEN 0 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_AUTOSTART - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GRTC_CONFIG_AUTOSTART -#define NRFX_GRTC_CONFIG_AUTOSTART 0 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS - * - * Integer value. - */ -#ifndef NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS -#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS 4 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK - */ -#ifndef NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK -#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK 0x00000f00 -#endif - -/** - * @brief NRFX_GRTC_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_GRTC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_GRTC_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_GRTC_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_GRTC_CONFIG_LOG_ENABLED -#define NRFX_GRTC_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_GRTC_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_GRTC_CONFIG_LOG_LEVEL -#define NRFX_GRTC_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_I2S_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_I2S_ENABLED -#define NRFX_I2S_ENABLED 0 -#endif - -/** - * @brief NRFX_I2S_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_I2S_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_I2S_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_I2S_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_I2S_CONFIG_LOG_ENABLED -#define NRFX_I2S_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_I2S_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_I2S_CONFIG_LOG_LEVEL -#define NRFX_I2S_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_I2S130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_I2S130_ENABLED -#define NRFX_I2S130_ENABLED 0 -#endif - -/** - * @brief NRFX_I2S131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_I2S131_ENABLED -#define NRFX_I2S131_ENABLED 0 -#endif - -/** - * @brief NRFX_IPCT_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000030 -#endif - -/** - * @brief NRFX_IPCT120_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT120_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT120_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_IPCT130_PUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT130_PUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT130_PUB_CONFIG_ALLOWED_CHANNELS_MASK 0x0000000c -#endif - -/** - * @brief NRFX_IPCT_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x000000c0 -#endif - -/** - * @brief NRFX_IPCT120_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT120_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT120_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0 -#endif - -/** - * @brief NRFX_IPCT130_SUB_CONFIG_ALLOWED_CHANNELS_MASK - */ -#ifndef NRFX_IPCT130_SUB_CONFIG_ALLOWED_CHANNELS_MASK -#define NRFX_IPCT130_SUB_CONFIG_ALLOWED_CHANNELS_MASK 0x00000003 -#endif - -/** - * @brief NRFX_LPCOMP_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_LPCOMP_ENABLED -#define NRFX_LPCOMP_ENABLED 0 -#endif - -/** - * @brief NRFX_LPCOMP_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_LPCOMP_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_LPCOMP_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_LPCOMP_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_LPCOMP_CONFIG_LOG_ENABLED -#define NRFX_LPCOMP_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_LPCOMP_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_LPCOMP_CONFIG_LOG_LEVEL -#define NRFX_LPCOMP_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_MVDMA_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_MVDMA_ENABLED -#define NRFX_MVDMA_ENABLED 0 -#endif - -/** - * @brief NRFX_MVDMA120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_MVDMA120_ENABLED -#define NRFX_MVDMA120_ENABLED 0 -#endif - -/** - * @brief NRFX_MVDMA121_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_MVDMA121_ENABLED -#define NRFX_MVDMA121_ENABLED 0 -#endif - -/** - * @brief NRFX_PDM_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PDM_ENABLED -#define NRFX_PDM_ENABLED 0 -#endif - -/** - * @brief NRFX_PDM_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_PDM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_PDM_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_PDM_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PDM_CONFIG_LOG_ENABLED -#define NRFX_PDM_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_PDM_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_PDM_CONFIG_LOG_LEVEL -#define NRFX_PDM_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_PRS_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_ENABLED -#define NRFX_PRS_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_CONFIG_LOG_ENABLED -#define NRFX_PRS_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_PRS_CONFIG_LOG_LEVEL -#define NRFX_PRS_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_PRS_BOX_0_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_0_ENABLED -#define NRFX_PRS_BOX_0_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_1_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_1_ENABLED -#define NRFX_PRS_BOX_1_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_2_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_2_ENABLED -#define NRFX_PRS_BOX_2_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_3_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_3_ENABLED -#define NRFX_PRS_BOX_3_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_4_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_4_ENABLED -#define NRFX_PRS_BOX_4_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_5_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_5_ENABLED -#define NRFX_PRS_BOX_5_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_6_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_6_ENABLED -#define NRFX_PRS_BOX_6_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_7_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_7_ENABLED -#define NRFX_PRS_BOX_7_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_8_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_8_ENABLED -#define NRFX_PRS_BOX_8_ENABLED 0 -#endif - -/** - * @brief NRFX_PRS_BOX_9_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PRS_BOX_9_ENABLED -#define NRFX_PRS_BOX_9_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM_ENABLED -#define NRFX_PWM_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_PWM_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM_CONFIG_LOG_ENABLED -#define NRFX_PWM_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_PWM_CONFIG_LOG_LEVEL -#define NRFX_PWM_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_PWM120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM120_ENABLED -#define NRFX_PWM120_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM130_ENABLED -#define NRFX_PWM130_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM131_ENABLED -#define NRFX_PWM131_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM132_ENABLED -#define NRFX_PWM132_ENABLED 0 -#endif - -/** - * @brief NRFX_PWM133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_PWM133_ENABLED -#define NRFX_PWM133_ENABLED 0 -#endif - -/** - * @brief NRFX_QDEC_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_QDEC_ENABLED -#define NRFX_QDEC_ENABLED 0 -#endif - -/** - * @brief NRFX_QDEC_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_QDEC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_QDEC_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_QDEC_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_QDEC_CONFIG_LOG_ENABLED -#define NRFX_QDEC_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_QDEC_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_QDEC_CONFIG_LOG_LEVEL -#define NRFX_QDEC_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_QDEC130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_QDEC130_ENABLED -#define NRFX_QDEC130_ENABLED 0 -#endif - -/** - * @brief NRFX_QDEC131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_QDEC131_ENABLED -#define NRFX_QDEC131_ENABLED 0 -#endif - -/** - * @brief NRFX_RTC_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_RTC_ENABLED -#define NRFX_RTC_ENABLED 0 -#endif - -/** - * @brief NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_RTC_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_RTC_CONFIG_LOG_ENABLED -#define NRFX_RTC_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_RTC_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_RTC_CONFIG_LOG_LEVEL -#define NRFX_RTC_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_RTC130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_RTC130_ENABLED -#define NRFX_RTC130_ENABLED 0 -#endif - -/** - * @brief NRFX_RTC131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_RTC131_ENABLED -#define NRFX_RTC131_ENABLED 0 -#endif - -/** - * @brief NRFX_SAADC_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SAADC_ENABLED -#define NRFX_SAADC_ENABLED 0 -#endif - -/** - * @brief NRFX_SAADC_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_SAADC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SAADC_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_SAADC_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SAADC_CONFIG_LOG_ENABLED -#define NRFX_SAADC_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_SAADC_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_SAADC_CONFIG_LOG_LEVEL -#define NRFX_SAADC_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_SPIM_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM_ENABLED -#define NRFX_SPIM_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_SPIM_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM_CONFIG_LOG_ENABLED -#define NRFX_SPIM_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_SPIM_CONFIG_LOG_LEVEL -#define NRFX_SPIM_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_SPIM120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM120_ENABLED -#define NRFX_SPIM120_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM121_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM121_ENABLED -#define NRFX_SPIM121_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM130_ENABLED -#define NRFX_SPIM130_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM131_ENABLED -#define NRFX_SPIM131_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM132_ENABLED -#define NRFX_SPIM132_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM133_ENABLED -#define NRFX_SPIM133_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM134_ENABLED -#define NRFX_SPIM134_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM135_ENABLED -#define NRFX_SPIM135_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM136_ENABLED -#define NRFX_SPIM136_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIM137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIM137_ENABLED -#define NRFX_SPIM137_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS_ENABLED -#define NRFX_SPIS_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_SPIS_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS_CONFIG_LOG_ENABLED -#define NRFX_SPIS_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_SPIS_CONFIG_LOG_LEVEL -#define NRFX_SPIS_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_SPIS120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS120_ENABLED -#define NRFX_SPIS120_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS130_ENABLED -#define NRFX_SPIS130_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS131_ENABLED -#define NRFX_SPIS131_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS132_ENABLED -#define NRFX_SPIS132_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS133_ENABLED -#define NRFX_SPIS133_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS134_ENABLED -#define NRFX_SPIS134_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS135_ENABLED -#define NRFX_SPIS135_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS136_ENABLED -#define NRFX_SPIS136_ENABLED 0 -#endif - -/** - * @brief NRFX_SPIS137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SPIS137_ENABLED -#define NRFX_SPIS137_ENABLED 0 -#endif - -/** - * @brief NRFX_SYSTICK_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_SYSTICK_ENABLED -#define NRFX_SYSTICK_ENABLED 0 -#endif - -/** - * @brief NRFX_TEMP_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TEMP_ENABLED -#define NRFX_TEMP_ENABLED 0 -#endif - -/** - * @brief NRFX_TEMP_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_TEMP_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TEMP_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_TEMP_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TEMP_CONFIG_LOG_ENABLED -#define NRFX_TEMP_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_TEMP_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_TEMP_CONFIG_LOG_LEVEL -#define NRFX_TEMP_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_TIMER_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER_ENABLED -#define NRFX_TIMER_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_TIMER_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER_CONFIG_LOG_ENABLED -#define NRFX_TIMER_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_TIMER_CONFIG_LOG_LEVEL -#define NRFX_TIMER_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_TIMER020_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER020_ENABLED -#define NRFX_TIMER020_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER021_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER021_ENABLED -#define NRFX_TIMER021_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER022_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER022_ENABLED -#define NRFX_TIMER022_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER120_ENABLED -#define NRFX_TIMER120_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER121_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER121_ENABLED -#define NRFX_TIMER121_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER130_ENABLED -#define NRFX_TIMER130_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER131_ENABLED -#define NRFX_TIMER131_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER132_ENABLED -#define NRFX_TIMER132_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER133_ENABLED -#define NRFX_TIMER133_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER134_ENABLED -#define NRFX_TIMER134_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER135_ENABLED -#define NRFX_TIMER135_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER136_ENABLED -#define NRFX_TIMER136_ENABLED 0 -#endif - -/** - * @brief NRFX_TIMER137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TIMER137_ENABLED -#define NRFX_TIMER137_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM_ENABLED -#define NRFX_TWIM_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_TWIM_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM_CONFIG_LOG_ENABLED -#define NRFX_TWIM_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_TWIM_CONFIG_LOG_LEVEL -#define NRFX_TWIM_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_TWIM130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM130_ENABLED -#define NRFX_TWIM130_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM131_ENABLED -#define NRFX_TWIM131_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM132_ENABLED -#define NRFX_TWIM132_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM133_ENABLED -#define NRFX_TWIM133_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM134_ENABLED -#define NRFX_TWIM134_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM135_ENABLED -#define NRFX_TWIM135_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM136_ENABLED -#define NRFX_TWIM136_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIM137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIM137_ENABLED -#define NRFX_TWIM137_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS_ENABLED -#define NRFX_TWIS_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_TWIS_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS_CONFIG_LOG_ENABLED -#define NRFX_TWIS_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY - * - * Assume that any instance would be initialized only once. - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY -#define NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY 0 -#endif - -/** - * @brief NRFX_TWIS_NO_SYNC_MODE - Remove support for synchronous mode. - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS_NO_SYNC_MODE -#define NRFX_TWIS_NO_SYNC_MODE 0 -#endif - -/** - * @brief NRFX_TWIS_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_TWIS_CONFIG_LOG_LEVEL -#define NRFX_TWIS_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_TWIS130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS130_ENABLED -#define NRFX_TWIS130_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS131_ENABLED -#define NRFX_TWIS131_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS132_ENABLED -#define NRFX_TWIS132_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS133_ENABLED -#define NRFX_TWIS133_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS134_ENABLED -#define NRFX_TWIS134_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS135_ENABLED -#define NRFX_TWIS135_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS136_ENABLED -#define NRFX_TWIS136_ENABLED 0 -#endif - -/** - * @brief NRFX_TWIS137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_TWIS137_ENABLED -#define NRFX_TWIS137_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_ENABLED -#define NRFX_UARTE_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG - * - * If enabled, support for configuring GPIO pins is removed from the driver. - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG -#define NRFX_UARTE_CONFIG_SKIP_GPIO_CONFIG 0 -#endif - -/** - * @brief NRFX_UARTE_CONFIG_SKIP_PSEL_CONFIG - * - * If enabled, support for configuring PSEL registers is removed from the driver. - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_CONFIG_SKIP_PSEL_CONFIG -#define NRFX_UARTE_CONFIG_SKIP_PSEL_CONFIG 0 -#endif - -/** - * @brief NRFX_UARTE_CONFIG_TX_LINK - If enabled, driver supports linking of TX transfers. - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_CONFIG_TX_LINK -#define NRFX_UARTE_CONFIG_TX_LINK 1 -#endif - -/** - * @brief NRFX_UARTE_CONFIG_RX_CACHE_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_CONFIG_RX_CACHE_ENABLED -#define NRFX_UARTE_CONFIG_RX_CACHE_ENABLED 1 -#endif - -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - -/** - * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_UARTE_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE_CONFIG_LOG_ENABLED -#define NRFX_UARTE_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_UARTE_CONFIG_LOG_LEVEL -#define NRFX_UARTE_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_UARTE120_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE120_ENABLED -#define NRFX_UARTE120_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE130_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE130_ENABLED -#define NRFX_UARTE130_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE131_ENABLED -#define NRFX_UARTE131_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE132_ENABLED -#define NRFX_UARTE132_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE133_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE133_ENABLED -#define NRFX_UARTE133_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE134_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE134_ENABLED -#define NRFX_UARTE134_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE135_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE135_ENABLED -#define NRFX_UARTE135_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE136_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE136_ENABLED -#define NRFX_UARTE136_ENABLED 0 -#endif - -/** - * @brief NRFX_UARTE137_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_UARTE137_ENABLED -#define NRFX_UARTE137_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT_ENABLED -#define NRFX_WDT_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY - * - * Integer value. Minimum: 0. Maximum: 7. - */ -#ifndef NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY NRFX_DEFAULT_IRQ_PRIORITY -#endif - -/** - * @brief NRFX_WDT_CONFIG_NO_IRQ - Remove WDT IRQ handling from WDT driver - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT_CONFIG_NO_IRQ -#define NRFX_WDT_CONFIG_NO_IRQ 0 -#endif - -/** - * @brief NRFX_WDT_CONFIG_LOG_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT_CONFIG_LOG_ENABLED -#define NRFX_WDT_CONFIG_LOG_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT_CONFIG_LOG_LEVEL - * - * Integer value. - * Supported values: - * - Off = 0 - * - Error = 1 - * - Warning = 2 - * - Info = 3 - * - Debug = 4 - */ -#ifndef NRFX_WDT_CONFIG_LOG_LEVEL -#define NRFX_WDT_CONFIG_LOG_LEVEL 3 -#endif - -/** - * @brief NRFX_WDT010_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT010_ENABLED -#define NRFX_WDT010_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT011_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT011_ENABLED -#define NRFX_WDT011_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT131_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT131_ENABLED -#define NRFX_WDT131_ENABLED 0 -#endif - -/** - * @brief NRFX_WDT132_ENABLED - * - * Boolean. Accepted values: 0 and 1. - */ -#ifndef NRFX_WDT132_ENABLED -#define NRFX_WDT132_ENABLED 0 -#endif - -#endif /* NRFX_CONFIG_NRF9230_ENGB_RADIOCORE_H__ */ diff --git a/soc/nordic/Kconfig b/soc/nordic/Kconfig index 906116e606a..5ed7459ded4 100644 --- a/soc/nordic/Kconfig +++ b/soc/nordic/Kconfig @@ -18,7 +18,6 @@ rsource "*/Kconfig" config NRF_SOC_SECURE_SUPPORTED def_bool !TRUSTED_EXECUTION_NONSECURE || (BUILD_WITH_TFM && TFM_PARTITION_PLATFORM) depends on !SOC_SERIES_NRF54HX - depends on !SOC_SERIES_NRF92X help Hidden function to indicate that that the soc_secure functions are available. diff --git a/soc/nordic/Kconfig.defconfig b/soc/nordic/Kconfig.defconfig index 0ac3c5ec3db..5e7e9c5a09d 100644 --- a/soc/nordic/Kconfig.defconfig +++ b/soc/nordic/Kconfig.defconfig @@ -11,7 +11,7 @@ rsource "*/Kconfig.defconfig" if SYS_CLOCK_EXISTS config CLOCK_CONTROL - default y if (!SOC_SERIES_NRF54HX && !SOC_SERIES_NRF92X) + default y if !SOC_SERIES_NRF54HX endif # SYS_CLOCK_EXISTS diff --git a/soc/nordic/Kconfig.soc b/soc/nordic/Kconfig.soc index 6851c25becf..2e47fcb4736 100644 --- a/soc/nordic/Kconfig.soc +++ b/soc/nordic/Kconfig.soc @@ -14,7 +14,6 @@ config SOC_SERIES default "nrf54h" if SOC_SERIES_NRF54HX default "nrf54l" if SOC_SERIES_NRF54LX default "nrf91" if SOC_SERIES_NRF91X - default "nrf92" if SOC_SERIES_NRF92X config SOC_FAMILY_NORDIC_NRF bool @@ -57,10 +56,4 @@ config SOC_SERIES_NRF91X help Enable support for NRF91 MCU series -config SOC_SERIES_NRF92X - bool - select SOC_FAMILY_NORDIC_NRF - help - Enable support for NRF92 MCU series - rsource "*/Kconfig.soc" diff --git a/soc/nordic/common/vpr/Kconfig.sysbuild b/soc/nordic/common/vpr/Kconfig.sysbuild index 4fd5f259869..52666138e45 100644 --- a/soc/nordic/common/vpr/Kconfig.sysbuild +++ b/soc/nordic/common/vpr/Kconfig.sysbuild @@ -4,7 +4,7 @@ config VPR_LAUNCHER bool "VPR launcher" default y - depends on (SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR || SOC_NRF54L15_ENGA_CPUFLPR || SOC_NRF9280_CPUPPR) + depends on (SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR || SOC_NRF54L15_ENGA_CPUFLPR) help Include VPR launcher in build. VPR launcher is a minimal sample built for an ARM core that starts given VPR core. diff --git a/soc/nordic/nrf92/CMakeLists.txt b/soc/nordic/nrf92/CMakeLists.txt deleted file mode 100644 index 1aa4723814f..00000000000 --- a/soc/nordic/nrf92/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor -# SPDX-License-Identifier: Apache-2.0 - -if(CONFIG_ARM) - zephyr_library_sources(soc.c) -endif() - -zephyr_include_directories(.) - -# Ensure that image size aligns with 16 bytes so that MRAMC finalizes all writes -# for the image correctly -zephyr_linker_sources(SECTIONS SORT_KEY zzz_place_align_at_end align.ld) diff --git a/soc/nordic/nrf92/Kconfig b/soc/nordic/nrf92/Kconfig deleted file mode 100644 index c3dd3a31114..00000000000 --- a/soc/nordic/nrf92/Kconfig +++ /dev/null @@ -1,47 +0,0 @@ -# Nordic Semiconductor nRF92 MCU line - -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config SOC_SERIES_NRF92X - select HAS_NRFS - select HAS_NRFX - select HAS_NORDIC_DRIVERS - select NRF_PLATFORM_HALTIUM - -config SOC_NRF9230_ENGB_CPUAPP - select ARM - select ARMV8_M_DSP - select CPU_CORTEX_M33 - select CPU_HAS_ARM_MPU - select CPU_HAS_ARM_SAU - select CPU_HAS_DCACHE - select CPU_HAS_ICACHE - select CPU_HAS_FPU - select CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS - select HAS_NORDIC_DMM - select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE - select NRFS_HAS_CLOCK_SERVICE - select NRFS_HAS_DVFS_SERVICE - select NRFS_HAS_MRAM_SERVICE - select NRFS_HAS_TEMP_SERVICE - select NRFS_HAS_VBUS_DETECTOR_SERVICE - -config SOC_NRF9230_ENGB_CPURAD - select ARM - select ARMV8_M_DSP - select CPU_CORTEX_M33 - select CPU_HAS_ARM_MPU - select CPU_HAS_ARM_SAU - select CPU_HAS_DCACHE - select CPU_HAS_ICACHE - select CPU_HAS_FPU - select CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS - select HAS_NORDIC_DMM - select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE - select NRFS_HAS_CLOCK_SERVICE - select NRFS_HAS_MRAM_SERVICE - select NRFS_HAS_TEMP_SERVICE - -config SOC_NRF9230_ENGB_CPUPPR - depends on RISCV_CORE_NORDIC_VPR diff --git a/soc/nordic/nrf92/Kconfig.defconfig b/soc/nordic/nrf92/Kconfig.defconfig deleted file mode 100644 index 5d1b6385a05..00000000000 --- a/soc/nordic/nrf92/Kconfig.defconfig +++ /dev/null @@ -1,41 +0,0 @@ -# Nordic Semiconductor nRF92 MCU line - -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if SOC_SERIES_NRF92X - -rsource "Kconfig.defconfig.nrf92*" - -if ARM - -config CACHE_NRF_CACHE - default y if EXTERNAL_CACHE - -endif # ARM - -if RISCV - -DT_CHOSEN_Z_SRAM = zephyr,sram -DT_CHOSEN_Z_CODE = zephyr,code-partition - -config BUILD_OUTPUT_ADJUST_LMA - depends on !XIP - default "$(dt_chosen_partition_addr_hex,$(DT_CHOSEN_Z_CODE)) - \ - $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_SRAM))" - -config BUILD_OUTPUT_HEX - default y - -config SYS_CLOCK_HW_CYCLES_PER_SEC - default 1000000 if NRF_GRTC_TIMER - -endif # RISCV - -config SPI_DW_HSSI - default y if SPI_DW - -config SPI_DW_ACCESS_WORD_ONLY - default y if SPI_DW - -endif # SOC_SERIES_NRF92X diff --git a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp deleted file mode 100644 index 350f44b5c24..00000000000 --- a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuapp +++ /dev/null @@ -1,14 +0,0 @@ -# Nordic Semiconductor nRF9280 Application MCU - -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if SOC_NRF9280_CPUAPP - -config NUM_IRQS - default 471 - -config NRF_REGTOOL_GENERATE_UICR - default y - -endif # SOC_NRF9280_CPUAPP diff --git a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuppr b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuppr deleted file mode 100644 index 9c29f6d295f..00000000000 --- a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpuppr +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if SOC_NRF9280_CPUPPR - -config NUM_IRQS - default 496 - -config SYS_CLOCK_TICKS_PER_SEC - default 1000 - -endif # SOC_NRF9280_CPUPPR diff --git a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad b/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad deleted file mode 100644 index 9b17a6b988c..00000000000 --- a/soc/nordic/nrf92/Kconfig.defconfig.nrf9280_cpurad +++ /dev/null @@ -1,14 +0,0 @@ -# Nordic Semiconductor nRF9280 Radio MCU - -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if SOC_NRF9280_CPURAD - -config NUM_IRQS - default 471 - -config NRF_REGTOOL_GENERATE_UICR - default y - -endif # SOC_NRF9280_CPURAD diff --git a/soc/nordic/nrf92/Kconfig.soc b/soc/nordic/nrf92/Kconfig.soc deleted file mode 100644 index 99fc28643b7..00000000000 --- a/soc/nordic/nrf92/Kconfig.soc +++ /dev/null @@ -1,66 +0,0 @@ -# Nordic Semiconductor nRF9280 MCU line - -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Similarly to other nRF91 family products, the nRF9280 is a -# SiP (System-in-Package) consisting of the nRF9230 SoC and -# additional components such as PMIC and others. -# Additionally, the nRF9230 contains several CPUs, similarly -# to the nRF54h20 SoC. -# -# Like it's done for the nRF91 family, let the nRF9280 SiP -# be represented by nRF9280 "SoC" in top-level SoC definitions -# and user-configurable Kconfigs, since that's what visible to users. -# -# Keep a nRF9230 Kconfig for the SoC under the hood, complete with -# the engineering version, because that's what the MDK/nrfx expects -# as build target, and so that its definition can also be re-used -# for other SiPs. - -config SOC_NRF9230_ENGB - bool - select SOC_SERIES_NRF92X - -config SOC_NRF9230_ENGB_CPUAPP - bool - select SOC_NRF9230_ENGB - -config SOC_NRF9230_ENGB_CPURAD - bool - select SOC_NRF9230_ENGB - -config SOC_NRF9230_ENGB_CPUPPR - bool - select SOC_NRF9230_ENGB - -# The SiP selects the actual SoC complete with engineer revision and appropriate CPU -config SOC_NRF9280 - bool - select SOC_NRF9230_ENGB_CPUAPP if SOC_NRF9280_CPUAPP - select SOC_NRF9230_ENGB_CPURAD if SOC_NRF9280_CPURAD - select SOC_NRF9230_ENGB_CPUPPR if SOC_NRF9280_CPUPPR - help - nRF9280 SiP - -# The CPU select the "SoC" (SiP) -config SOC_NRF9280_CPUAPP - bool - select SOC_NRF9280 - help - nRF9280 CPUAPP - -config SOC_NRF9280_CPURAD - bool - select SOC_NRF9280 - help - nRF9280 CPURAD - -config SOC_NRF9280_CPUPPR - bool - select SOC_NRF9280 - help - nRF9280 CPUPPR - -config SOC - default "nrf9280" if SOC_NRF9280 diff --git a/soc/nordic/nrf92/align.ld b/soc/nordic/nrf92/align.ld deleted file mode 100644 index 0905aa7f7bc..00000000000 --- a/soc/nordic/nrf92/align.ld +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA. - * SPDX-License-Identifier: Apache-2.0 - */ - -SECTION_PROLOGUE(.align16,,) -{ - . = (ALIGN(16) > 0 ? ALIGN(16) : 16) - 1; - BYTE(0); -} GROUP_LINK_IN(ROMABLE_REGION) diff --git a/soc/nordic/nrf92/soc.c b/soc/nordic/nrf92/soc.c deleted file mode 100644 index 1a40bb58dda..00000000000 --- a/soc/nordic/nrf92/soc.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); - -#if defined(NRF_APPLICATION) -#define HSFLL_NODE DT_NODELABEL(cpuapp_hsfll) -#elif defined(NRF_RADIOCORE) -#define HSFLL_NODE DT_NODELABEL(cpurad_hsfll) -#endif - -#define FICR_ADDR_GET(node_id, name) \ - DT_REG_ADDR(DT_PHANDLE_BY_NAME(node_id, nordic_ficrs, name)) + \ - DT_PHA_BY_NAME(node_id, nordic_ficrs, name, offset) - -#define SPU_INSTANCE_GET(p_addr) \ - ((NRF_SPU_Type *)((p_addr) & (ADDRESS_REGION_Msk | \ - ADDRESS_SECURITY_Msk | \ - ADDRESS_DOMAIN_Msk | \ - ADDRESS_BUS_Msk))) - -static void power_domain_init(void) -{ - /* - * Set: - * - LRCCONF010.POWERON.MAIN: 1 - * - LRCCONF010.POWERON.ACT: 1 - * - LRCCONF010.RETAIN.MAIN: 1 - * - LRCCONF010.RETAIN.ACT: 1 - * - * This is done here at boot so that when the idle routine will hit - * WFI the power domain will be correctly retained. - */ - - nrf_lrcconf_poweron_force_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_MAIN, true); - nrf_lrcconf_poweron_force_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_DOMAIN_0, true); - - nrf_lrcconf_retain_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_MAIN, true); - nrf_lrcconf_retain_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_DOMAIN_0, true); -} - -static int trim_hsfll(void) -{ -#if defined(HSFLL_NODE) - - NRF_HSFLL_Type *hsfll = (NRF_HSFLL_Type *)DT_REG_ADDR(HSFLL_NODE); - nrf_hsfll_trim_t trim = { - .vsup = sys_read32(FICR_ADDR_GET(HSFLL_NODE, vsup)), - .coarse = sys_read32(FICR_ADDR_GET(HSFLL_NODE, coarse)), - .fine = sys_read32(FICR_ADDR_GET(HSFLL_NODE, fine)) - }; - - LOG_DBG("Trim: HSFLL VSUP: 0x%.8x", trim.vsup); - LOG_DBG("Trim: HSFLL COARSE: 0x%.8x", trim.coarse); - LOG_DBG("Trim: HSFLL FINE: 0x%.8x", trim.fine); - - nrf_hsfll_clkctrl_mult_set(hsfll, - DT_PROP(HSFLL_NODE, clock_frequency) / - DT_PROP(DT_CLOCKS_CTLR(HSFLL_NODE), clock_frequency)); - nrf_hsfll_trim_set(hsfll, &trim); - - nrf_hsfll_task_trigger(hsfll, NRF_HSFLL_TASK_FREQ_CHANGE); - - LOG_DBG("NRF_HSFLL->TRIM.VSUP = %d", hsfll->TRIM.VSUP); - LOG_DBG("NRF_HSFLL->TRIM.COARSE = %d", hsfll->TRIM.COARSE); - LOG_DBG("NRF_HSFLL->TRIM.FINE = %d", hsfll->TRIM.FINE); - -#endif /* defined(HSFLL_NODE) */ - - return 0; -} - -static int nordicsemi_nrf92_init(void) -{ - sys_cache_instr_enable(); - sys_cache_data_enable(); - - power_domain_init(); - - trim_hsfll(); - -#if DT_NODE_HAS_STATUS(DT_NODELABEL(ccm030), okay) - /* DMASEC is set to non-secure by default, which prevents CCM from - * accessing secure memory. Change DMASEC to secure. - */ - uint32_t ccm030_addr = DT_REG_ADDR(DT_NODELABEL(ccm030)); - NRF_SPU_Type *spu = SPU_INSTANCE_GET(ccm030_addr); - - 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); diff --git a/soc/nordic/nrf92/soc.h b/soc/nordic/nrf92/soc.h deleted file mode 100644 index 4a495cfcaa1..00000000000 --- a/soc/nordic/nrf92/soc.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef SOC_ARM_NORDIC_NRF_NRF9280_SOC_H_ -#define SOC_ARM_NORDIC_NRF_NRF9280_SOC_H_ - -#include - -#endif /* SOC_ARM_NORDIC_NRF_NRF9280_SOC_H_ */ diff --git a/soc/nordic/soc.yml b/soc/nordic/soc.yml index 2f0b5caab16..73e4aea0474 100644 --- a/soc/nordic/soc.yml +++ b/soc/nordic/soc.yml @@ -38,13 +38,6 @@ family: - name: nrf9151 - name: nrf9160 - name: nrf9161 - - name: nrf92 - socs: - - name: nrf9280 - cpuclusters: - - name: cpuapp - - name: cpurad - - name: cpuppr # Recovery/erase is only needed once per core. Prevent resetting the cores whilst flashing # multiple images until all images for each core have been flashed, this allows security @@ -76,10 +69,6 @@ runners: - nrf54h20/cpuapp - nrf54h20/cpurad - nrf54h20/cpuppr - - qualifiers: - - nrf9280/cpuapp - - nrf9280/cpurad - - nrf9280/cpuppr '--erase': - runners: - nrfjprog @@ -106,10 +95,6 @@ runners: - nrf54h20/cpuapp - nrf54h20/cpurad - nrf54h20/cpuppr - - qualifiers: - - nrf9280/cpuapp - - nrf9280/cpurad - - nrf9280/cpuppr '--reset': - runners: - nrfjprog @@ -136,7 +121,3 @@ runners: - nrf54h20/cpuapp - nrf54h20/cpurad - nrf54h20/cpuppr - - qualifiers: - - nrf9280/cpuapp - - nrf9280/cpurad - - nrf9280/cpuppr From 62245ada6a83fe16d237d1fb2e0daa13a4d83946 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 028/825] Revert "[nrf noup] soc: nordic: ensure clean merge of initial nRF9280 SiP part1" This reverts commit 822976da973a116a232b2c1ffb98718cafe351c0. --- soc/nordic/Kconfig.defconfig | 2 +- soc/nordic/common/vpr/Kconfig.sysbuild | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/soc/nordic/Kconfig.defconfig b/soc/nordic/Kconfig.defconfig index 5e7e9c5a09d..513d1240d53 100644 --- a/soc/nordic/Kconfig.defconfig +++ b/soc/nordic/Kconfig.defconfig @@ -11,7 +11,7 @@ rsource "*/Kconfig.defconfig" if SYS_CLOCK_EXISTS config CLOCK_CONTROL - default y if !SOC_SERIES_NRF54HX + default y endif # SYS_CLOCK_EXISTS diff --git a/soc/nordic/common/vpr/Kconfig.sysbuild b/soc/nordic/common/vpr/Kconfig.sysbuild index 52666138e45..54464f10bc4 100644 --- a/soc/nordic/common/vpr/Kconfig.sysbuild +++ b/soc/nordic/common/vpr/Kconfig.sysbuild @@ -4,7 +4,7 @@ config VPR_LAUNCHER bool "VPR launcher" default y - depends on (SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR || SOC_NRF54L15_ENGA_CPUFLPR) + depends on (SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR || SOC_NRF54L15_ENGA_CPUFLPR || SOC_NRF54L15_CPUFLPR || SOC_NRF9280_CPUPPR) help Include VPR launcher in build. VPR launcher is a minimal sample built for an ARM core that starts given VPR core. From daa314e5a8f3922f6bc0bc0de0f6425b0aa9b8ec Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 029/825] Revert "[nrf fromtree] soc: nordic: common: add CAN121 to nrf54hx_nrf92x_mpu_regions.c" This reverts commit fdc28c98a5868ffc5213e298ce4c9eba20d99daf. --- soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c b/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c index 66659588411..a86161f3cbe 100644 --- a/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c +++ b/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c @@ -14,10 +14,6 @@ #define CAN120_SIZE DT_REG_SIZE_BY_NAME(DT_NODELABEL(can120), message_ram) + \ DT_REG_SIZE_BY_NAME(DT_NODELABEL(can120), m_can) -#define CAN121_BASE DT_REG_ADDR_BY_NAME(DT_NODELABEL(can121), message_ram) -#define CAN121_SIZE DT_REG_SIZE_BY_NAME(DT_NODELABEL(can121), message_ram) + \ - DT_REG_SIZE_BY_NAME(DT_NODELABEL(can121), m_can) - static struct arm_mpu_region mpu_regions[] = { MPU_REGION_ENTRY("FLASH_0", CONFIG_FLASH_BASE_ADDRESS, @@ -36,10 +32,6 @@ static struct arm_mpu_region mpu_regions[] = { MPU_REGION_ENTRY("CAN120_MCAN", CAN120_BASE, REGION_RAM_NOCACHE_ATTR(CAN120_BASE, CAN120_SIZE)), #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(can121), okay) - MPU_REGION_ENTRY("CAN121_MCAN", CAN121_BASE, - REGION_RAM_NOCACHE_ATTR(CAN121_BASE, CAN121_SIZE)), -#endif }; const struct arm_mpu_config mpu_config = { From ede827af9e3e94cae9b2a1028598a22b6fdfad5f Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 030/825] Revert "[nrf fromtree] soc: nordic: move mpu_regions.c to common folder and rename" This reverts commit 11e48e05145b253a94fbd3d61a85a9b4a367239e. --- soc/nordic/common/CMakeLists.txt | 4 ---- soc/nordic/nrf54h/CMakeLists.txt | 2 ++ .../nrf54hx_nrf92x_mpu_regions.c => nrf54h/mpu_regions.c} | 0 3 files changed, 2 insertions(+), 4 deletions(-) rename soc/nordic/{common/nrf54hx_nrf92x_mpu_regions.c => nrf54h/mpu_regions.c} (100%) diff --git a/soc/nordic/common/CMakeLists.txt b/soc/nordic/common/CMakeLists.txt index fe4b8b92a0b..abf8b80d3fa 100644 --- a/soc/nordic/common/CMakeLists.txt +++ b/soc/nordic/common/CMakeLists.txt @@ -7,10 +7,6 @@ zephyr_linker_sources_ifdef(CONFIG_ARM SECTIONS arm_platform_init.ld) zephyr_library_sources_ifdef(CONFIG_POWEROFF poweroff.c) -if((CONFIG_SOC_SERIES_NRF54HX OR CONFIG_SOC_SERIES_NRF92X) AND CONFIG_CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS) - zephyr_library_sources(nrf54hx_nrf92x_mpu_regions.c) -endif() - zephyr_include_directories(.) if(CONFIG_HAS_NORDIC_DMM) diff --git a/soc/nordic/nrf54h/CMakeLists.txt b/soc/nordic/nrf54h/CMakeLists.txt index 0496841ffe7..bcacf704736 100644 --- a/soc/nordic/nrf54h/CMakeLists.txt +++ b/soc/nordic/nrf54h/CMakeLists.txt @@ -8,6 +8,8 @@ if(CONFIG_ARM) endif() endif() +zephyr_library_sources_ifdef(CONFIG_CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS mpu_regions.c) + zephyr_library_sources_ifdef(CONFIG_PM_S2RAM pm_s2ram.c) zephyr_include_directories(.) diff --git a/soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c b/soc/nordic/nrf54h/mpu_regions.c similarity index 100% rename from soc/nordic/common/nrf54hx_nrf92x_mpu_regions.c rename to soc/nordic/nrf54h/mpu_regions.c From 4e9191b00c4b716de5bf3bf5dab1ce3fd2114241 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 031/825] Revert "[nrf noup] soc: nordic: ensure clean pick move mpu_regions.c to common" This reverts commit 5d0672fbafd22fa0cc7c79bb4887ba9c81136954. --- soc/nordic/nrf54h/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/soc/nordic/nrf54h/CMakeLists.txt b/soc/nordic/nrf54h/CMakeLists.txt index bcacf704736..1d1867fb1e7 100644 --- a/soc/nordic/nrf54h/CMakeLists.txt +++ b/soc/nordic/nrf54h/CMakeLists.txt @@ -9,7 +9,6 @@ if(CONFIG_ARM) endif() zephyr_library_sources_ifdef(CONFIG_CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS mpu_regions.c) - zephyr_library_sources_ifdef(CONFIG_PM_S2RAM pm_s2ram.c) zephyr_include_directories(.) From fe5865075abd1489433286111f1fc6d79fa8eb96 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 032/825] Revert "[nrf fromtree] dts: Add initial support for nRF9280 SiP" This reverts commit b5f9af7e626cf4f77e5f62cbcdad83c07216abf2. --- dts/arm/nordic/nrf9280_cpuapp.dtsi | 62 - dts/arm/nordic/nrf9280_cpurad.dtsi | 79 - dts/common/nordic/nrf9280.dtsi | 1270 ----------------- dts/riscv/nordic/nrf9280_cpuppr.dtsi | 58 - .../misc/nordic-domain-id-nrf9230.h | 15 - .../misc/nordic-nrf-ficr-nrf9230-engb.h | 110 -- .../misc/nordic-owner-id-nrf9230.h | 14 - 7 files changed, 1608 deletions(-) delete mode 100644 dts/arm/nordic/nrf9280_cpuapp.dtsi delete mode 100644 dts/arm/nordic/nrf9280_cpurad.dtsi delete mode 100644 dts/common/nordic/nrf9280.dtsi delete mode 100644 dts/riscv/nordic/nrf9280_cpuppr.dtsi delete mode 100644 include/zephyr/dt-bindings/misc/nordic-domain-id-nrf9230.h delete mode 100644 include/zephyr/dt-bindings/misc/nordic-nrf-ficr-nrf9230-engb.h delete mode 100644 include/zephyr/dt-bindings/misc/nordic-owner-id-nrf9230.h diff --git a/dts/arm/nordic/nrf9280_cpuapp.dtsi b/dts/arm/nordic/nrf9280_cpuapp.dtsi deleted file mode 100644 index 29edae31051..00000000000 --- a/dts/arm/nordic/nrf9280_cpuapp.dtsi +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -cpu: &cpuapp {}; -systick: &cpuapp_systick {}; -nvic: &cpuapp_nvic {}; -cpuppr_vevif: &cpuppr_vevif_tx {}; -cpusys_vevif: &cpusys_vevif_tx {}; -wdt010: &cpuapp_wdt010 {}; -wdt011: &cpuapp_wdt011 {}; - -/delete-node/ &cpuppr; -/delete-node/ &cpurad; -/delete-node/ &cpurad_peripherals; -/delete-node/ &cpurad_ppb; -/delete-node/ &cpurad_ram0; - -/ { - soc { - compatible = "simple-bus"; - interrupt-parent = <&cpuapp_nvic>; - ranges; - }; -}; - -&cpuapp_ppb { - compatible = "simple-bus"; - ranges; -}; - -&cpusec_bellboard { - compatible = "nordic,nrf-bellboard-tx"; -}; - -&cpuapp_bellboard { - compatible = "nordic,nrf-bellboard-rx"; -}; - -&cpurad_bellboard { - compatible = "nordic,nrf-bellboard-tx"; -}; - -&cpucell_bellboard { - compatible = "nordic,nrf-bellboard-tx"; -}; - -&gpiote130 { - interrupts = <105 NRF_DEFAULT_IRQ_PRIORITY>; -}; - -&gpiote131 { - interrupts = <107 NRF_DEFAULT_IRQ_PRIORITY>; -}; - -&grtc { - interrupts = <109 NRF_DEFAULT_IRQ_PRIORITY>; -}; diff --git a/dts/arm/nordic/nrf9280_cpurad.dtsi b/dts/arm/nordic/nrf9280_cpurad.dtsi deleted file mode 100644 index 265cd623953..00000000000 --- a/dts/arm/nordic/nrf9280_cpurad.dtsi +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -cpu: &cpurad {}; -systick: &cpurad_systick {}; -nvic: &cpurad_nvic {}; -cpuppr_vevif: &cpuppr_vevif_tx {}; -cpusys_vevif: &cpusys_vevif_tx {}; -wdt010: &cpurad_wdt010 {}; -wdt011: &cpurad_wdt011 {}; - -/delete-node/ &cpuapp; -/delete-node/ &cpuapp_peripherals; -/delete-node/ &cpuapp_ppb; -/delete-node/ &cpuapp_ram0; -/delete-node/ &cpuppr; - -/ { - soc { - compatible = "simple-bus"; - interrupt-parent = <&cpurad_nvic>; - ranges; - }; -}; - -&cpurad_ppb { - compatible = "simple-bus"; - ranges; -}; - -&cpusec_bellboard { - compatible = "nordic,nrf-bellboard-tx"; -}; - -&cpuapp_bellboard { - compatible = "nordic,nrf-bellboard-tx"; -}; - -&cpurad_bellboard { - compatible = "nordic,nrf-bellboard-rx"; -}; - -&gpiote130 { - interrupts = <105 NRF_DEFAULT_IRQ_PRIORITY>; -}; - -&grtc { - owned-channels = <7 8 9 10 11 12 13 14 15>; - child-owned-channels = <8 9 10 11 12>; - nonsecure-channels = <8 9 10 11 12>; - interrupts = <109 NRF_DEFAULT_IRQ_PRIORITY>, - <109 NRF_DEFAULT_IRQ_PRIORITY>, - <110 NRF_DEFAULT_IRQ_PRIORITY>; -}; - -&dppic130 { - owned-channels = <0>; - sink-channels = <0>; - nonsecure-channels = <0>; - status = "okay"; -}; - -&dppic132 { - owned-channels = <0>; - source-channels = <0>; - nonsecure-channels = <0>; - status = "okay"; -}; - -&ipct130 { - owned-channels = <0>; - source-channel-links = <0 3 0>; - status = "okay"; -}; diff --git a/dts/common/nordic/nrf9280.dtsi b/dts/common/nordic/nrf9280.dtsi deleted file mode 100644 index 166c8658354..00000000000 --- a/dts/common/nordic/nrf9280.dtsi +++ /dev/null @@ -1,1270 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -#include -#include -#include - -/delete-node/ &sw_pwm; - -/ { - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpuapp: cpu@2 { - compatible = "arm,cortex-m33"; - reg = <2>; - device_type = "cpu"; - clock-frequency = ; - }; - - cpurad: cpu@3 { - compatible = "arm,cortex-m33"; - reg = <3>; - device_type = "cpu"; - clock-frequency = ; - }; - - cpuppr: cpu@d { - compatible = "nordic,vpr"; - reg = <13>; - device_type = "cpu"; - clock-frequency = ; - riscv,isa = "rv32emc"; - nordic,bus-width = <32>; - - cpuppr_vevif_rx: mailbox { - compatible = "nordic,nrf-vevif-task-rx"; - status = "disabled"; - interrupt-parent = <&cpuppr_clic>; - interrupts = <0 NRF_DEFAULT_IRQ_PRIORITY>, - <1 NRF_DEFAULT_IRQ_PRIORITY>, - <2 NRF_DEFAULT_IRQ_PRIORITY>, - <3 NRF_DEFAULT_IRQ_PRIORITY>, - <4 NRF_DEFAULT_IRQ_PRIORITY>, - <5 NRF_DEFAULT_IRQ_PRIORITY>, - <6 NRF_DEFAULT_IRQ_PRIORITY>, - <7 NRF_DEFAULT_IRQ_PRIORITY>, - <8 NRF_DEFAULT_IRQ_PRIORITY>, - <9 NRF_DEFAULT_IRQ_PRIORITY>, - <10 NRF_DEFAULT_IRQ_PRIORITY>, - <11 NRF_DEFAULT_IRQ_PRIORITY>, - <12 NRF_DEFAULT_IRQ_PRIORITY>, - <13 NRF_DEFAULT_IRQ_PRIORITY>, - <14 NRF_DEFAULT_IRQ_PRIORITY>, - <15 NRF_DEFAULT_IRQ_PRIORITY>; - #mbox-cells = <1>; - nordic,tasks = <16>; - nordic,tasks-mask = <0x0000fff0>; - }; - }; - }; - - reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - - cpurad_uicr_ext: memory@e401000 { - reg = <0xe401000 DT_SIZE_K(2)>; - }; - - cpuapp_uicr_ext: memory@e401800 { - reg = <0xe401800 DT_SIZE_K(2)>; - }; - }; - - clocks { - hfxo: hfxo { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - - fll16m: fll16m { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = ; - }; - }; - - soc { - #address-cells = <1>; - #size-cells = <1>; - - mram1x: mram@e000000 { - compatible = "nordic,mram"; - reg = <0xe000000 DT_SIZE_K(8192)>; - erase-block-size = <4096>; - write-block-size = <16>; - }; - - cpuapp_uicr: uicr@fff8000 { - compatible = "nordic,nrf-uicr-v2"; - reg = <0xfff8000 DT_SIZE_K(2)>; - domain = <2>; - ptr-ext-uicr = <&cpuapp_uicr_ext>; - }; - - cpurad_uicr: uicr@fffa000 { - compatible = "nordic,nrf-uicr-v2"; - reg = <0xfffa000 DT_SIZE_K(2)>; - domain = <3>; - ptr-ext-uicr = <&cpurad_uicr_ext>; - }; - - ficr: ficr@fffe000 { - compatible = "nordic,nrf-ficr"; - reg = <0xfffe000 DT_SIZE_K(2)>; - #nordic,ficr-cells = <1>; - }; - - cpuapp_ram0: sram@22000000 { - compatible = "mmio-sram"; - reg = <0x22000000 DT_SIZE_K(32)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x22000000 0x8000>; - }; - - cpurad_ram0: sram@23000000 { - compatible = "mmio-sram"; - reg = <0x23000000 DT_SIZE_K(192)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x23000000 0x30000>; - }; - - cpurad_ram1: sram@23040000 { - compatible = "mmio-sram"; - reg = <0x23040000 DT_SIZE_K(32)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x23040000 0x8000>; - }; - - cpuapp_peripherals: peripheral@52000000 { - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x52000000 0x1000000>; - - cpuapp_hsfll: clock@d000 { - compatible = "nordic,nrf-hsfll"; - #clock-cells = <0>; - reg = <0xd000 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"; - }; - - cpuapp_ipct: ipct@13000 { - compatible = "nordic,nrf-ipct-local"; - reg = <0x13000 0x1000>; - status = "disabled"; - channels = <4>; - interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>, - <65 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - cpuapp_wdt010: watchdog@14000 { - compatible = "nordic,nrf-wdt"; - reg = <0x14000 0x1000>; - status = "disabled"; - interrupts = <20 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - cpuapp_wdt011: watchdog@15000 { - compatible = "nordic,nrf-wdt"; - reg = <0x15000 0x1000>; - status = "disabled"; - interrupts = <21 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - cpuapp_ieee802154: ieee802154 { - compatible = "nordic,nrf-ieee802154"; - status = "disabled"; - }; - - cpuapp_resetinfo: resetinfo@1e000 { - compatible = "nordic,nrf-resetinfo"; - reg = <0x1e000 0x1000>; - }; - }; - - cpurad_peripherals: peripheral@53000000 { - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x53000000 0x1000000>; - - cpurad_hsfll: clock@d000 { - compatible = "nordic,nrf-hsfll"; - #clock-cells = <0>; - reg = <0xd000 0x1000>; - clocks = <&fll16m>; - clock-frequency = ; - nordic,ficrs = - <&ficr NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_VSUP>, - <&ficr NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_COARSE_1>, - <&ficr NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_FINE_1>; - nordic,ficr-names = "vsup", "coarse", "fine"; - }; - - cpurad_wdt010: watchdog@13000 { - compatible = "nordic,nrf-wdt"; - reg = <0x13000 0x1000>; - status = "disabled"; - interrupts = <19 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - cpurad_wdt011: watchdog@14000 { - compatible = "nordic,nrf-wdt"; - reg = <0x14000 0x1000>; - status = "disabled"; - interrupts = <20 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - cpurad_resetinfo: resetinfo@1e000 { - compatible = "nordic,nrf-resetinfo"; - reg = <0x1e000 0x1000>; - }; - - dppic020: dppic@22000 { - compatible = "nordic,nrf-dppic-local"; - reg = <0x22000 0x1000>; - status = "disabled"; - }; - - cpurad_ipct: ipct@24000 { - compatible = "nordic,nrf-ipct-local"; - reg = <0x24000 0x1000>; - status = "disabled"; - channels = <8>; - interrupts = <64 NRF_DEFAULT_IRQ_PRIORITY>, - <65 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - egu020: egu@25000 { - compatible = "nordic,nrf-egu"; - reg = <0x25000 0x1000>; - status = "disabled"; - interrupts = <37 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - timer020: timer@28000 { - compatible = "nordic,nrf-timer"; - reg = <0x28000 0x1000>; - status = "disabled"; - cc-num = <8>; - interrupts = <40 NRF_DEFAULT_IRQ_PRIORITY>; - max-bit-width = <32>; - max-frequency = ; - prescaler = <0>; - }; - - timer021: timer@29000 { - compatible = "nordic,nrf-timer"; - reg = <0x29000 0x1000>; - status = "disabled"; - cc-num = <8>; - interrupts = <41 NRF_DEFAULT_IRQ_PRIORITY>; - max-bit-width = <32>; - max-frequency = ; - prescaler = <0>; - }; - - timer022: timer@2a000 { - compatible = "nordic,nrf-timer"; - reg = <0x2a000 0x1000>; - status = "disabled"; - cc-num = <8>; - interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; - max-bit-width = <32>; - max-frequency = ; - prescaler = <0>; - }; - - rtc: rtc@2b000 { - compatible = "nordic,nrf-rtc"; - reg = <0x2b000 0x1000>; - status = "disabled"; - cc-num = <4>; - clock-frequency = <32768>; - interrupts = <43 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <1>; - }; - - radio: radio@2c000 { - compatible = "nordic,nrf-radio"; - reg = <0x2c000 0x1000>; - status = "disabled"; - ble-2mbps-supported; - ble-coded-phy-supported; - dfe-supported; - ieee802154-supported; - interrupts = <44 NRF_DEFAULT_IRQ_PRIORITY>; - - cpurad_ieee802154: ieee802154 { - compatible = "nordic,nrf-ieee802154"; - status = "disabled"; - }; - }; - - ccm030: ccm@3a000 { - compatible = "nordic,nrf-ccm"; - reg = <0x3a000 0x1000>; - interrupts = <58 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - ecb030: ecb@3b000 { - compatible = "nordic,nrf-ecb"; - reg = <0x3b000 0x1000>; - interrupts = <59 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - ccm031: ccm@3c000 { - compatible = "nordic,nrf-ccm"; - reg = <0x3c000 0x1000>; - interrupts = <60 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - ecb031: ecb@3d000 { - compatible = "nordic,nrf-ecb"; - reg = <0x3d000 0x1000>; - status = "disabled"; - interrupts = <61 NRF_DEFAULT_IRQ_PRIORITY>; - }; - }; - - global_peripherals: peripheral@5f000000 { - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x5f000000 0x1000000>; - - usbhs: usbhs@86000 { - compatible = "nordic,nrf-usbhs", "snps,dwc2"; - reg = <0x86000 0x1000>, <0x2f700000 0x40000>; - reg-names = "wrapper", "core"; - interrupts = <134 NRF_DEFAULT_IRQ_PRIORITY>; - num-in-eps = <8>; - num-out-eps = <10>; - ghwcfg1 = <0xaa555000>; - ghwcfg2 = <0x22abfc72>; - ghwcfg4 = <0x1e10aa60>; - status = "disabled"; - }; - - exmif: spi@95000 { - compatible = "nordic,nrf-exmif"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x95000 0x500 0x95500 0xb00>; - reg-names = "wrapper", "core"; - interrupts = <149 NRF_DEFAULT_IRQ_PRIORITY>; - clock-frequency = ; - fifo-depth = <32>; - max-xfer-size = <16>; - status = "disabled"; - }; - - cpusec_bellboard: mailbox@99000 { - reg = <0x99000 0x1000>; - status = "disabled"; - #mbox-cells = <1>; - }; - - cpuapp_bellboard: mailbox@9a000 { - reg = <0x9a000 0x1000>; - status = "disabled"; - #mbox-cells = <1>; - }; - - cpurad_bellboard: mailbox@9b000 { - reg = <0x9b000 0x1000>; - status = "disabled"; - #mbox-cells = <1>; - }; - - cpucell_bellboard: mailbox@9c000 { - reg = <0x9c000 0x1000>; - status = "disabled"; - #mbox-cells = <1>; - }; - - canpll: clock-controller@8c2000{ - compatible = "nordic,nrf-auxpll"; - reg = <0x8c2000 0x1000>; - interrupts = <194 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfxo>; - #clock-cells = <0>; - nordic,ficrs = <&ficr NRF_FICR_TRIM_GLOBAL_CANPLL_TRIM_CTUNE>; - nordic,frequency = <0>; - nordic,out-div = <2>; - nordic,out-drive = <0>; - nordic,current-tune = <6>; - nordic,sdm-disable; - nordic,range = "high"; - status = "disabled"; - }; - - cpusys_vevif_tx: mailbox@8c8000 { - compatible = "nordic,nrf-vevif-task-tx"; - reg = <0x8c8000 0x1000>; - status = "disabled"; - #mbox-cells = <1>; - nordic,tasks = <32>; - nordic,tasks-mask = <0xfffff0ff>; - }; - - ipct120: ipct@8d1000 { - compatible = "nordic,nrf-ipct-global"; - reg = <0x8d1000 0x1000>; - status = "disabled"; - channels = <8>; - global-domain-id = <12>; - }; - - can120: can@8d8000 { - compatible = "nordic,nrf-can"; - reg = <0x8d8000 0x400>, <0x2fbef800 0x800>, <0x2fbe8000 0x7800>; - reg-names = "wrapper", "m_can", "message_ram"; - interrupts = <216 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&canpll>; - bosch,mram-cfg = <0x0 28 8 3 3 0 1 1>; - status = "disabled"; - }; - - can121: can@8db000 { - compatible = "nordic,nrf-can"; - reg = <0x8db000 0x400>, <0x2fbf7800 0x800>, <0x2fbf0000 0x7800>; - reg-names = "wrapper", "m_can", "message_ram"; - interrupts = <219 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&canpll>; - bosch,mram-cfg = <0x0 28 8 3 3 0 1 1>; - status = "disabled"; - }; - - dppic120: dppic@8e1000 { - compatible = "nordic,nrf-dppic-global"; - reg = <0x8e1000 0x1000>; - status = "disabled"; - }; - - timer120: timer@8e2000 { - compatible = "nordic,nrf-timer"; - reg = <0x8e2000 0x1000>; - status = "disabled"; - cc-num = <6>; - interrupts = <226 NRF_DEFAULT_IRQ_PRIORITY>; - max-bit-width = <32>; - max-frequency = ; - prescaler = <0>; - }; - - timer121: timer@8e3000 { - compatible = "nordic,nrf-timer"; - reg = <0x8e3000 0x1000>; - status = "disabled"; - cc-num = <6>; - interrupts = <227 NRF_DEFAULT_IRQ_PRIORITY>; - max-bit-width = <32>; - max-frequency = ; - prescaler = <0>; - }; - - pwm120: pwm@8e4000 { - compatible = "nordic,nrf-pwm"; - reg = <0x8e4000 0x1000>; - status = "disabled"; - interrupts = <228 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - }; - - spi120: spi@8e6000 { - compatible = "nordic,nrf-spim"; - reg = <0x8e6000 0x1000>; - status = "disabled"; - easydma-maxcnt-bits = <15>; - interrupts = <230 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - rx-delay-supported; - rx-delay = <1>; - nordic,clockpin-enable = , - ; - }; - - uart120: uart@8e6000 { - compatible = "nordic,nrf-uarte"; - reg = <0x8e6000 0x1000>; - status = "disabled"; - interrupts = <230 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - spi121: spi@8e7000 { - compatible = "nordic,nrf-spim"; - reg = <0x8e7000 0x1000>; - status = "disabled"; - easydma-maxcnt-bits = <15>; - interrupts = <231 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - rx-delay-supported; - rx-delay = <1>; - nordic,clockpin-enable = , - ; - }; - - cpuppr_vpr: vpr@908000 { - compatible = "nordic,nrf-vpr-coprocessor"; - reg = <0x908000 0x1000>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x908000 0x1000>; - - cpuppr_vevif_tx: mailbox@0 { - compatible = "nordic,nrf-vevif-task-tx"; - reg = <0x0 0x1000>; - status = "disabled"; - #mbox-cells = <1>; - nordic,tasks = <16>; - nordic,tasks-mask = <0x0000fff0>; - }; - }; - - ipct130: ipct@921000 { - compatible = "nordic,nrf-ipct-global"; - reg = <0x921000 0x1000>; - status = "disabled"; - channels = <8>; - global-domain-id = <13>; - }; - - dppic130: dppic@922000 { - compatible = "nordic,nrf-dppic-global"; - reg = <0x922000 0x1000>; - status = "disabled"; - }; - - rtc130: rtc@928000 { - compatible = "nordic,nrf-rtc"; - reg = <0x928000 0x1000>; - status = "disabled"; - cc-num = <4>; - clock-frequency = <32768>; - interrupts = <296 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <1>; - }; - - rtc131: rtc@929000 { - compatible = "nordic,nrf-rtc"; - reg = <0x929000 0x1000>; - status = "disabled"; - cc-num = <4>; - clock-frequency = <32768>; - interrupts = <297 NRF_DEFAULT_IRQ_PRIORITY>; - prescaler = <1>; - }; - - wdt131: watchdog@92b000 { - compatible = "nordic,nrf-wdt"; - reg = <0x92b000 0x1000>; - status = "disabled"; - interrupts = <299 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - wdt132: watchdog@92c000 { - compatible = "nordic,nrf-wdt"; - reg = <0x92c000 0x1000>; - status = "disabled"; - interrupts = <300 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - gpiote130: gpiote@934000 { - compatible = "nordic,nrf-gpiote"; - reg = <0x934000 0x1000>; - status = "disabled"; - instance = <130>; - }; - - gpiote131: gpiote@935000 { - compatible = "nordic,nrf-gpiote"; - reg = <0x935000 0x1000>; - status = "disabled"; - instance = <131>; - }; - - gpio0: gpio@938000 { - compatible = "nordic,nrf-gpio"; - reg = <0x938000 0x200>; - status = "disabled"; - #gpio-cells = <2>; - gpio-controller; - gpiote-instance = <&gpiote130>; - ngpios = <13>; - port = <0>; - }; - - gpio1: gpio@938200 { - compatible = "nordic,nrf-gpio"; - reg = <0x938200 0x200>; - status = "disabled"; - #gpio-cells = <2>; - gpio-controller; - gpiote-instance = <&gpiote130>; - ngpios = <12>; - port = <1>; - }; - - gpio2: gpio@938400 { - compatible = "nordic,nrf-gpio"; - reg = <0x938400 0x200>; - status = "disabled"; - #gpio-cells = <2>; - gpio-controller; - gpiote-instance = <&gpiote130>; - ngpios = <12>; - port = <2>; - }; - - gpio6: gpio@938c00 { - compatible = "nordic,nrf-gpio"; - reg = <0x938c00 0x200>; - status = "disabled"; - #gpio-cells = <2>; - gpio-controller; - ngpios = <14>; - port = <6>; - }; - - gpio8: gpio@939000 { - compatible = "nordic,nrf-gpio"; - reg = <0x939000 0x200>; - status = "disabled"; - #gpio-cells = <2>; - gpio-controller; - ngpios = <5>; - port = <8>; - }; - - gpio9: gpio@939200 { - compatible = "nordic,nrf-gpio"; - reg = <0x939200 0x200>; - status = "disabled"; - #gpio-cells = <2>; - gpio-controller; - gpiote-instance = <&gpiote130>; - ngpios = <6>; - port = <9>; - }; - - gpio10: gpio@939400 { - compatible = "nordic,nrf-gpio"; - reg = <0x939400 0x200>; - status = "disabled"; - #gpio-cells = <2>; - gpio-controller; - ngpios = <8>; - port = <10>; - }; - - gpio11: gpio@939600 { - compatible = "nordic,nrf-gpio"; - reg = <0x939600 0x200>; - status = "disabled"; - #gpio-cells = <2>; - gpio-controller; - gpiote-instance = <&gpiote131>; - ngpios = <8>; - port = <11>; - }; - - gpio12: gpio@939800 { - compatible = "nordic,nrf-gpio"; - reg = <0x939800 0x200>; - status = "disabled"; - #gpio-cells = <2>; - gpio-controller; - gpiote-instance = <&gpiote131>; - ngpios = <3>; - port = <12>; - }; - - gpio13: gpio@939a00 { - compatible = "nordic,nrf-gpio"; - reg = <0x939a00 0x200>; - status = "disabled"; - #gpio-cells = <2>; - gpio-controller; - gpiote-instance = <&gpiote131>; - ngpios = <4>; - port = <13>; - }; - - dppic131: dppic@981000 { - compatible = "nordic,nrf-dppic-global"; - reg = <0x981000 0x1000>; - status = "disabled"; - }; - - adc: adc@982000 { - compatible = "nordic,nrf-saadc"; - reg = <0x982000 0x1000>; - interrupts = <386 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - #io-channel-cells = <1>; - }; - - comp: comparator@983000 { - compatible = "nordic,nrf-comp"; - reg = <0x983000 0x1000>; - status = "disabled"; - interrupts = <387 NRF_DEFAULT_IRQ_PRIORITY>; - #io-channel-cells = <1>; - }; - - temp: temperature-sensor@984000 { - compatible = "nordic,nrf-temp"; - reg = <0x984000 0x1000>; - interrupts = <388 NRF_DEFAULT_IRQ_PRIORITY>; - status = "disabled"; - }; - - dppic132: dppic@991000 { - compatible = "nordic,nrf-dppic-global"; - reg = <0x991000 0x1000>; - status = "disabled"; - }; - - qdec130: qdec@994000 { - compatible = "nordic,nrf-qdec"; - reg = <0x994000 0x1000>; - status = "disabled"; - interrupts = <404 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - qdec131: qdec@995000 { - compatible = "nordic,nrf-qdec"; - reg = <0x995000 0x1000>; - status = "disabled"; - interrupts = <405 NRF_DEFAULT_IRQ_PRIORITY>; - }; - - grtc: grtc@99c000 { - compatible = "nordic,nrf-grtc"; - reg = <0x99c000 0x1000>; - status = "disabled"; - cc-num = <16>; - }; - - dppic133: dppic@9a1000 { - compatible = "nordic,nrf-dppic-global"; - reg = <0x9a1000 0x1000>; - status = "disabled"; - }; - - timer130: timer@9a2000 { - compatible = "nordic,nrf-timer"; - reg = <0x9a2000 0x1000>; - status = "disabled"; - cc-num = <6>; - interrupts = <418 NRF_DEFAULT_IRQ_PRIORITY>; - max-bit-width = <32>; - prescaler = <0>; - }; - - timer131: timer@9a3000 { - compatible = "nordic,nrf-timer"; - reg = <0x9a3000 0x1000>; - status = "disabled"; - cc-num = <6>; - interrupts = <419 NRF_DEFAULT_IRQ_PRIORITY>; - max-bit-width = <32>; - prescaler = <0>; - }; - - pwm130: pwm@9a4000 { - compatible = "nordic,nrf-pwm"; - reg = <0x9a4000 0x1000>; - status = "disabled"; - interrupts = <420 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - }; - - i2c130: i2c@9a5000 { - compatible = "nordic,nrf-twim"; - reg = <0x9a5000 0x1000>; - status = "disabled"; - interrupts = <421 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - nordic,clockpin-enable = , - ; - }; - - spi130: spi@9a5000 { - compatible = "nordic,nrf-spim"; - reg = <0x9a5000 0x1000>; - status = "disabled"; - easydma-maxcnt-bits = <15>; - interrupts = <421 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - rx-delay-supported; - rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; - }; - - uart130: uart@9a5000 { - compatible = "nordic,nrf-uarte"; - reg = <0x9a5000 0x1000>; - status = "disabled"; - interrupts = <421 NRF_DEFAULT_IRQ_PRIORITY>; - nordic,clockpin-enable = ; - }; - - i2c131: i2c@9a6000 { - compatible = "nordic,nrf-twim"; - reg = <0x9a6000 0x1000>; - status = "disabled"; - interrupts = <422 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - nordic,clockpin-enable = , - ; - }; - - spi131: spi@9a6000 { - compatible = "nordic,nrf-spim"; - reg = <0x9a6000 0x1000>; - status = "disabled"; - easydma-maxcnt-bits = <15>; - interrupts = <422 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - rx-delay-supported; - rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; - }; - - uart131: uart@9a6000 { - compatible = "nordic,nrf-uarte"; - reg = <0x9a6000 0x1000>; - status = "disabled"; - interrupts = <422 NRF_DEFAULT_IRQ_PRIORITY>; - nordic,clockpin-enable = ; - }; - - dppic134: dppic@9b1000 { - compatible = "nordic,nrf-dppic-global"; - reg = <0x9b1000 0x1000>; - status = "disabled"; - }; - - timer132: timer@9b2000 { - compatible = "nordic,nrf-timer"; - reg = <0x9b2000 0x1000>; - status = "disabled"; - cc-num = <6>; - interrupts = <434 NRF_DEFAULT_IRQ_PRIORITY>; - max-bit-width = <32>; - prescaler = <0>; - }; - - timer133: timer@9b3000 { - compatible = "nordic,nrf-timer"; - reg = <0x9b3000 0x1000>; - status = "disabled"; - cc-num = <6>; - interrupts = <435 NRF_DEFAULT_IRQ_PRIORITY>; - max-bit-width = <32>; - prescaler = <0>; - }; - - pwm131: pwm@9b4000 { - compatible = "nordic,nrf-pwm"; - reg = <0x9b4000 0x1000>; - status = "disabled"; - interrupts = <436 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - }; - - i2c132: i2c@9b5000 { - compatible = "nordic,nrf-twim"; - reg = <0x9b5000 0x1000>; - status = "disabled"; - interrupts = <437 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - nordic,clockpin-enable = , - ; - }; - - spi132: spi@9b5000 { - compatible = "nordic,nrf-spim"; - reg = <0x9b5000 0x1000>; - status = "disabled"; - easydma-maxcnt-bits = <15>; - interrupts = <437 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - rx-delay-supported; - rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; - }; - - uart132: uart@9b5000 { - compatible = "nordic,nrf-uarte"; - reg = <0x9b5000 0x1000>; - status = "disabled"; - interrupts = <437 NRF_DEFAULT_IRQ_PRIORITY>; - nordic,clockpin-enable = ; - }; - - i2c133: i2c@9b6000 { - compatible = "nordic,nrf-twim"; - reg = <0x9b6000 0x1000>; - status = "disabled"; - interrupts = <438 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - nordic,clockpin-enable = , - ; - }; - - spi133: spi@9b6000 { - compatible = "nordic,nrf-spim"; - reg = <0x9b6000 0x1000>; - status = "disabled"; - easydma-maxcnt-bits = <15>; - interrupts = <438 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - rx-delay-supported; - rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; - }; - - uart133: uart@9b6000 { - compatible = "nordic,nrf-uarte"; - reg = <0x9b6000 0x1000>; - status = "disabled"; - interrupts = <438 NRF_DEFAULT_IRQ_PRIORITY>; - nordic,clockpin-enable = ; - }; - - dppic135: dppic@9c1000 { - compatible = "nordic,nrf-dppic-global"; - reg = <0x9c1000 0x1000>; - status = "disabled"; - }; - - timer134: timer@9c2000 { - compatible = "nordic,nrf-timer"; - reg = <0x9c2000 0x1000>; - status = "disabled"; - cc-num = <6>; - interrupts = <450 NRF_DEFAULT_IRQ_PRIORITY>; - max-bit-width = <32>; - prescaler = <0>; - }; - - timer135: timer@9c3000 { - compatible = "nordic,nrf-timer"; - reg = <0x9c3000 0x1000>; - status = "disabled"; - cc-num = <6>; - interrupts = <451 NRF_DEFAULT_IRQ_PRIORITY>; - max-bit-width = <32>; - prescaler = <0>; - }; - - pwm132: pwm@9c4000 { - compatible = "nordic,nrf-pwm"; - reg = <0x9c4000 0x1000>; - status = "disabled"; - interrupts = <452 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - }; - - i2c134: i2c@9c5000 { - compatible = "nordic,nrf-twim"; - reg = <0x9c5000 0x1000>; - status = "disabled"; - interrupts = <453 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - nordic,clockpin-enable = , - ; - }; - - spi134: spi@9c5000 { - compatible = "nordic,nrf-spim"; - reg = <0x9c5000 0x1000>; - status = "disabled"; - easydma-maxcnt-bits = <15>; - interrupts = <453 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - rx-delay-supported; - rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; - }; - - uart134: uart@9c5000 { - compatible = "nordic,nrf-uarte"; - reg = <0x9c5000 0x1000>; - status = "disabled"; - interrupts = <453 NRF_DEFAULT_IRQ_PRIORITY>; - nordic,clockpin-enable = ; - }; - - i2c135: i2c@9c6000 { - compatible = "nordic,nrf-twim"; - reg = <0x9c6000 0x1000>; - status = "disabled"; - interrupts = <454 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - nordic,clockpin-enable = , - ; - }; - - spi135: spi@9c6000 { - compatible = "nordic,nrf-spim"; - reg = <0x9c6000 0x1000>; - status = "disabled"; - easydma-maxcnt-bits = <15>; - interrupts = <454 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - rx-delay-supported; - rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; - }; - - uart135: uart@9c6000 { - compatible = "nordic,nrf-uarte"; - reg = <0x9c6000 0x1000>; - status = "disabled"; - interrupts = <454 NRF_DEFAULT_IRQ_PRIORITY>; - nordic,clockpin-enable = ; - }; - - dppic136: dppic@9d1000 { - compatible = "nordic,nrf-dppic-global"; - reg = <0x9d1000 0x1000>; - status = "disabled"; - }; - - timer136: timer@9d2000 { - compatible = "nordic,nrf-timer"; - reg = <0x9d2000 0x1000>; - status = "disabled"; - cc-num = <6>; - interrupts = <466 NRF_DEFAULT_IRQ_PRIORITY>; - max-bit-width = <32>; - prescaler = <0>; - }; - - timer137: timer@9d3000 { - compatible = "nordic,nrf-timer"; - reg = <0x9d3000 0x1000>; - status = "disabled"; - cc-num = <6>; - interrupts = <467 NRF_DEFAULT_IRQ_PRIORITY>; - max-bit-width = <32>; - prescaler = <0>; - }; - - pwm133: pwm@9d4000 { - compatible = "nordic,nrf-pwm"; - reg = <0x9d4000 0x1000>; - status = "disabled"; - interrupts = <468 NRF_DEFAULT_IRQ_PRIORITY>; - #pwm-cells = <3>; - }; - - i2c136: i2c@9d5000 { - compatible = "nordic,nrf-twim"; - reg = <0x9d5000 0x1000>; - status = "disabled"; - interrupts = <469 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - nordic,clockpin-enable = , - ; - }; - - spi136: spi@9d5000 { - compatible = "nordic,nrf-spim"; - reg = <0x9d5000 0x1000>; - status = "disabled"; - easydma-maxcnt-bits = <15>; - interrupts = <469 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - rx-delay-supported; - rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; - }; - - uart136: uart@9d5000 { - compatible = "nordic,nrf-uarte"; - reg = <0x9d5000 0x1000>; - status = "disabled"; - interrupts = <469 NRF_DEFAULT_IRQ_PRIORITY>; - nordic,clockpin-enable = ; - }; - - i2c137: i2c@9d6000 { - compatible = "nordic,nrf-twim"; - reg = <0x9d6000 0x1000>; - status = "disabled"; - interrupts = <470 NRF_DEFAULT_IRQ_PRIORITY>; - easydma-maxcnt-bits = <15>; - #address-cells = <1>; - #size-cells = <0>; - nordic,clockpin-enable = , - ; - }; - - spi137: spi@9d6000 { - compatible = "nordic,nrf-spim"; - reg = <0x9d6000 0x1000>; - status = "disabled"; - easydma-maxcnt-bits = <15>; - interrupts = <470 NRF_DEFAULT_IRQ_PRIORITY>; - max-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - rx-delay-supported; - rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; - }; - - uart137: uart@9d6000 { - compatible = "nordic,nrf-uarte"; - reg = <0x9d6000 0x1000>; - status = "disabled"; - interrupts = <470 NRF_DEFAULT_IRQ_PRIORITY>; - nordic,clockpin-enable = ; - }; - }; - }; - - cpuapp_ppb: cpuapp-ppb-bus { - #address-cells = <1>; - #size-cells = <1>; - - cpuapp_systick: timer@e000e010 { - compatible = "arm,armv8m-systick"; - reg = <0xe000e010 0x10>; - status = "disabled"; - }; - - cpuapp_nvic: interrupt-controller@e000e100 { - compatible = "arm,v8m-nvic"; - reg = <0xe000e100 0xc00>; - arm,num-irq-priority-bits = <3>; - #interrupt-cells = <2>; - interrupt-controller; - #address-cells = <1>; - }; - }; - - cpurad_ppb: cpurad-ppb-bus { - #address-cells = <1>; - #size-cells = <1>; - - cpurad_systick: timer@e000e010 { - compatible = "arm,armv8m-systick"; - reg = <0xe000e010 0x10>; - status = "disabled"; - }; - - cpurad_nvic: interrupt-controller@e000e100 { - compatible = "arm,v8m-nvic"; - reg = <0xe000e100 0xc00>; - arm,num-irq-priority-bits = <3>; - #interrupt-cells = <2>; - interrupt-controller; - #address-cells = <1>; - }; - }; - - cpuppr_private: cpuppr-private-bus { - #address-cells = <1>; - #size-cells = <1>; - - cpuppr_clic: interrupt-controller@5f909000 { - compatible = "nordic,nrf-clic"; - reg = <0x5f909000 0x3000>; - status = "disabled"; - #interrupt-cells = <2>; - interrupt-controller; - #address-cells = <1>; - }; - }; - - temp_nrfs: temp { - compatible = "nordic,nrf-temp-nrfs"; - status = "disabled"; - }; -}; diff --git a/dts/riscv/nordic/nrf9280_cpuppr.dtsi b/dts/riscv/nordic/nrf9280_cpuppr.dtsi deleted file mode 100644 index ad5fb3014e7..00000000000 --- a/dts/riscv/nordic/nrf9280_cpuppr.dtsi +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -cpu: &cpuppr {}; -clic: &cpuppr_clic {}; -cpuppr_vevif: &cpuppr_vevif_rx {}; -cpusys_vevif: &cpusys_vevif_tx {}; - -/delete-node/ &cpuapp; -/delete-node/ &cpuapp_peripherals; -/delete-node/ &cpuapp_ppb; -/delete-node/ &cpuapp_ram0; -/delete-node/ &cpurad; -/delete-node/ &cpurad_peripherals; -/delete-node/ &cpurad_ppb; -/delete-node/ &cpurad_ram0; - -/ { - soc { - compatible = "simple-bus"; - interrupt-parent = <&cpuppr_clic>; - ranges; - }; -}; - -&cpuppr_private { - compatible = "simple-bus"; - ranges; -}; - -&cpuppr_clic { - status = "okay"; -}; - -&cpusec_bellboard { - compatible = "nordic,nrf-bellboard-tx"; -}; - -&cpuapp_bellboard { - compatible = "nordic,nrf-bellboard-tx"; -}; - -&cpurad_bellboard { - compatible = "nordic,nrf-bellboard-tx"; -}; - -&gpiote130 { - interrupts = <104 NRF_DEFAULT_IRQ_PRIORITY>; -}; - -&grtc { - interrupts = <108 NRF_DEFAULT_IRQ_PRIORITY>; -}; diff --git a/include/zephyr/dt-bindings/misc/nordic-domain-id-nrf9230.h b/include/zephyr/dt-bindings/misc/nordic-domain-id-nrf9230.h deleted file mode 100644 index 8e4e1759486..00000000000 --- a/include/zephyr/dt-bindings/misc/nordic-domain-id-nrf9230.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_DOMAIN_ID_NRF9280_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_DOMAIN_ID_NRF9280_H_ - -#define NRF_DOMAIN_ID_APPLICATION 2 -#define NRF_DOMAIN_ID_RADIOCORE 3 -#define NRF_DOMAIN_ID_CELLCORE 4 -#define NRF_DOMAIN_ID_GLOBALFAST 12 -#define NRF_DOMAIN_ID_GLOBALSLOW 13 - -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_DOMAIN_ID_NRF9280_H_ */ diff --git a/include/zephyr/dt-bindings/misc/nordic-nrf-ficr-nrf9230-engb.h b/include/zephyr/dt-bindings/misc/nordic-nrf-ficr-nrf9230-engb.h deleted file mode 100644 index aec1950025b..00000000000 --- a/include/zephyr/dt-bindings/misc/nordic-nrf-ficr-nrf9230-engb.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/* autogenerated using Nordic HAL utils/gen_offsets.py script */ - -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_NRF_FICR_NRF9230_ENGB_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_NRF_FICR_NRF9230_ENGB_H_ - -#define NRF_FICR_BLE_ADDRTYPE 0x00CU -#define NRF_FICR_BLE_ADDR_0 0x010U -#define NRF_FICR_BLE_ADDR_1 0x014U -#define NRF_FICR_BLE_ER_0 0x018U -#define NRF_FICR_BLE_ER_1 0x01CU -#define NRF_FICR_BLE_ER_2 0x020U -#define NRF_FICR_BLE_ER_3 0x024U -#define NRF_FICR_BLE_IR_0 0x028U -#define NRF_FICR_BLE_IR_1 0x02CU -#define NRF_FICR_BLE_IR_2 0x030U -#define NRF_FICR_BLE_IR_3 0x034U -#define NRF_FICR_INFO_CONFIGID 0x050U -#define NRF_FICR_INFO_PART 0x054U -#define NRF_FICR_INFO_VARIANT 0x058U -#define NRF_FICR_INFO_PACKAGE 0x05CU -#define NRF_FICR_INFO_RAM 0x060U -#define NRF_FICR_INFO_MRAM 0x064U -#define NRF_FICR_INFO_CODEPAGESIZE 0x068U -#define NRF_FICR_INFO_CODESIZE 0x06CU -#define NRF_FICR_INFO_DEVICETYPE 0x070U -#define NRF_FICR_SIPINFO_OVERRIDE_LFOSC_CONFIG 0x0A4U -#define NRF_FICR_SIPINFO_OVERRIDE_LFOSC_LFXOCONFIG 0x0A8U -#define NRF_FICR_SIPINFO_OVERRIDE_LFOSC_LFXOCAL 0x0ACU -#define NRF_FICR_SIPINFO_OVERRIDE_LFOSC_LFRCAUTOCALCONFIG 0x0B0U -#define NRF_FICR_SIPINFO_OVERRIDE_HFXO64M_CONFIG 0x0B4U -#define NRF_FICR_SIPINFO_PARTNO 0x080U -#define NRF_FICR_SIPINFO_HWREVISION_0 0x084U -#define NRF_FICR_SIPINFO_HWREVISION_1 0x085U -#define NRF_FICR_SIPINFO_HWREVISION_2 0x086U -#define NRF_FICR_SIPINFO_HWREVISION_3 0x087U -#define NRF_FICR_SIPINFO_VARIANT_0 0x088U -#define NRF_FICR_SIPINFO_VARIANT_1 0x089U -#define NRF_FICR_SIPINFO_VARIANT_2 0x08AU -#define NRF_FICR_SIPINFO_VARIANT_3 0x08BU -#define NRF_FICR_SIPINFO_PMICVERSION 0x08CU -#define NRF_FICR_SIPINFO_TESTSITE_0 0x090U -#define NRF_FICR_SIPINFO_TESTSITE_1 0x091U -#define NRF_FICR_SIPINFO_TESTSITE_2 0x092U -#define NRF_FICR_SIPINFO_TESTSITE_3 0x093U -#define NRF_FICR_SIPINFO_LOT 0x094U -#define NRF_FICR_SIPINFO_TESTPROGRAMID_0 0x098U -#define NRF_FICR_SIPINFO_TESTPROGRAMID_1 0x099U -#define NRF_FICR_SIPINFO_TESTPROGRAMID_2 0x09AU -#define NRF_FICR_SIPINFO_TESTPROGRAMID_3 0x09BU -#define NRF_FICR_SIPINFO_OSATPARTNO 0x09CU -#define NRF_FICR_SIPINFO_HWBUILDVERSION_0 0x0A0U -#define NRF_FICR_SIPINFO_HWBUILDVERSION_1 0x0A1U -#define NRF_FICR_SIPINFO_HWBUILDVERSION_2 0x0A2U -#define NRF_FICR_SIPINFO_HWBUILDVERSION_3 0x0A3U -#define NRF_FICR_TRIM_GLOBAL_SAADC_CALVREF 0x344U -#define NRF_FICR_TRIM_GLOBAL_SAADC_CALGAIN_0 0x348U -#define NRF_FICR_TRIM_GLOBAL_SAADC_CALGAIN_1 0x34CU -#define NRF_FICR_TRIM_GLOBAL_SAADC_CALGAIN_2 0x350U -#define NRF_FICR_TRIM_GLOBAL_SAADC_CALOFFSET 0x354U -#define NRF_FICR_TRIM_GLOBAL_SAADC_LINCALCOEFF_0 0x358U -#define NRF_FICR_TRIM_GLOBAL_SAADC_LINCALCOEFF_1 0x35CU -#define NRF_FICR_TRIM_GLOBAL_SAADC_LINCALCOEFF_2 0x360U -#define NRF_FICR_TRIM_GLOBAL_SAADC_LINCALCOEFF_3 0x364U -#define NRF_FICR_TRIM_GLOBAL_SAADC_LINCALCOEFF_4 0x368U -#define NRF_FICR_TRIM_GLOBAL_SAADC_LINCALCOEFF_5 0x36CU -#define NRF_FICR_TRIM_GLOBAL_SAADC_CALIREF 0x370U -#define NRF_FICR_TRIM_GLOBAL_SAADC_CALVREFTC 0x374U -#define NRF_FICR_TRIM_GLOBAL_CANPLL_TRIM_CTUNE 0x380U -#define NRF_FICR_TRIM_GLOBAL_COMP_REFTRIM 0x390U -#define NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_VSUP 0x398U -#define NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_COARSE_0 0x39CU -#define NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_COARSE_1 0x3A0U -#define NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_COARSE_2 0x3A4U -#define NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_COARSE_3 0x3A8U -#define NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_COARSE_4 0x3ACU -#define NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_COARSE_5 0x3B0U -#define NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_FINE_0 0x3B4U -#define NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_FINE_1 0x3B8U -#define NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_FINE_2 0x3BCU -#define NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_FINE_3 0x3C0U -#define NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_FINE_4 0x3C4U -#define NRF_FICR_TRIM_APPLICATION_HSFLL_TRIM_FINE_5 0x3C8U -#define NRF_FICR_TRIM_APPLICATION_MEMCONF_BLOCKTYPE_0_TRIM 0x3CCU -#define NRF_FICR_TRIM_APPLICATION_MEMCONF_BLOCKTYPE_1_TRIM 0x3D0U -#define NRF_FICR_TRIM_APPLICATION_MEMCONF_BLOCKTYPE_2_TRIM 0x3D4U -#define NRF_FICR_TRIM_APPLICATION_MEMCONF_BLOCKTYPE_3_TRIM 0x3D8U -#define NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_VSUP 0x3DCU -#define NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_COARSE_0 0x3E0U -#define NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_COARSE_1 0x3E4U -#define NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_COARSE_2 0x3E8U -#define NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_COARSE_3 0x3ECU -#define NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_COARSE_4 0x3F0U -#define NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_COARSE_5 0x3F4U -#define NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_FINE_0 0x3F8U -#define NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_FINE_1 0x3FCU -#define NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_FINE_2 0x400U -#define NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_FINE_3 0x404U -#define NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_FINE_4 0x408U -#define NRF_FICR_TRIM_RADIOCORE_HSFLL_TRIM_FINE_5 0x40CU -#define NRF_FICR_TRIM_RADIOCORE_MEMCONF_BLOCKTYPE_0_TRIM 0x410U -#define NRF_FICR_TRIM_RADIOCORE_MEMCONF_BLOCKTYPE_1_TRIM 0x414U -#define NRF_FICR_TRIM_RADIOCORE_MEMCONF_BLOCKTYPE_2_TRIM 0x418U -#define NRF_FICR_TRIM_RADIOCORE_MEMCONF_BLOCKTYPE_3_TRIM 0x41CU - -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_NRF_FICR_NRF9230_ENGB_H_ */ diff --git a/include/zephyr/dt-bindings/misc/nordic-owner-id-nrf9230.h b/include/zephyr/dt-bindings/misc/nordic-owner-id-nrf9230.h deleted file mode 100644 index 6d9a8f28bf2..00000000000 --- a/include/zephyr/dt-bindings/misc/nordic-owner-id-nrf9230.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_OWNER_ID_NRF9280_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_OWNER_ID_NRF9280_H_ - -#define NRF_OWNER_ID_NONE 0 -#define NRF_OWNER_ID_APPLICATION 2 -#define NRF_OWNER_ID_RADIOCORE 3 -#define NRF_OWNER_ID_CELL 4 - -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_OWNER_ID_NRF9280_H_ */ From 35dc233e164de4be16a847fbbef3bac7bc99819c Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 033/825] Revert "[nrf fromtree] soc: nordic: introduce CONFIG_NRF_PLATFORM_HALTIUM" This reverts commit 6dec3775392d5127974eb9d415b133cb277c0dcc. --- soc/nordic/Kconfig | 7 ------- soc/nordic/nrf54h/Kconfig | 1 - 2 files changed, 8 deletions(-) diff --git a/soc/nordic/Kconfig b/soc/nordic/Kconfig index 5ed7459ded4..bb68a3f6110 100644 --- a/soc/nordic/Kconfig +++ b/soc/nordic/Kconfig @@ -170,11 +170,4 @@ config NRF_TRACE_PORT Unit) for tracing using a hardware probe. If disabled, the trace pins will be used as GPIO. -config NRF_PLATFORM_HALTIUM - bool - help - SoC series based on the Nordic nRF Haltium platform need to select - this option. This allows to easily enable common functionality on - SoCs based on the Haltium platform. - endif # SOC_FAMILY_NORDIC_NRF diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index db62be6eb51..b01996189b5 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -7,7 +7,6 @@ config SOC_SERIES_NRF54HX select HAS_NRFS select HAS_NRFX select HAS_NORDIC_DRIVERS - select NRF_PLATFORM_HALTIUM config SOC_NRF54H20_CPUAPP select ARM From 8c8940babc58f0acc42cdeb5788fd238a6a06dd3 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:50 +0200 Subject: [PATCH 034/825] Revert "[nrf fromtree] cmake: Adjust LMA for user-specified sections" This reverts commit 6a23a9065d7fb8987c26594c9bedde408c4e7e25. --- CMakeLists.txt | 5 +---- Kconfig.zephyr | 17 ----------------- cmake/bintools/gnu/target_bintools.cmake | 2 +- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f87a7d8553d..401060f989c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1579,14 +1579,11 @@ endif() if(CONFIG_BUILD_OUTPUT_ADJUST_LMA) math(EXPR adjustment "${CONFIG_BUILD_OUTPUT_ADJUST_LMA}" OUTPUT_FORMAT DECIMAL) - set(args_adjustment ${CONFIG_BUILD_OUTPUT_ADJUST_LMA_SECTIONS}) - list(TRANSFORM args_adjustment PREPEND $) - list(TRANSFORM args_adjustment APPEND +${adjustment}) list(APPEND post_build_commands COMMAND $ $ - ${args_adjustment} + $${adjustment} $${KERNEL_ELF_NAME} $${KERNEL_ELF_NAME} ) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 904999f9f66..adb72a219f9 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -813,23 +813,6 @@ config BUILD_OUTPUT_ADJUST_LMA default "$(dt_chosen_reg_addr_hex,$(DT_CHOSEN_IMAGE_M4))-\ $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))" -config BUILD_OUTPUT_ADJUST_LMA_SECTIONS - def_string "*" - depends on BUILD_OUTPUT_ADJUST_LMA!="" - help - This determines the output sections to which the above LMA adjustment - will be applied. - The value can be the name of a section in the final ELF, like "text". - It can also be a pattern with wildcards, such as "*bss", which could - match more than one section name. Multiple such patterns can be given - as a ";"-separated list. It's possible to supply a 'negative' pattern - starting with "!", to exclude sections matched by a preceding pattern. - - By default, all sections will have their LMA adjusted. The following - example excludes one section produced by the code relocation feature: - config BUILD_OUTPUT_ADJUST_LMA_SECTIONS - default "*;!.extflash_text_reloc" - config BUILD_OUTPUT_INFO_HEADER bool "Create a image information header" help diff --git a/cmake/bintools/gnu/target_bintools.cmake b/cmake/bintools/gnu/target_bintools.cmake index 0fa06ea7c32..f61860b31da 100644 --- a/cmake/bintools/gnu/target_bintools.cmake +++ b/cmake/bintools/gnu/target_bintools.cmake @@ -44,7 +44,7 @@ set_property(TARGET bintools PROPERTY elfconvert_flag_section_remove "--remove-s set_property(TARGET bintools PROPERTY elfconvert_flag_section_only "--only-section=") set_property(TARGET bintools PROPERTY elfconvert_flag_section_rename "--rename-section;") -set_property(TARGET bintools PROPERTY elfconvert_flag_lma_adjust "--change-section-lma;") +set_property(TARGET bintools PROPERTY elfconvert_flag_lma_adjust "--change-section-lma;*+") # Note, placing a ';' at the end results in the following param to be a list, # and hence space separated. From fbd5252658986a3d4a95a26a4d087da148150faf Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 035/825] Revert "[nrf fromtree] soc: nordic: common: dmm: Initialize dmm as early as possible" This reverts commit 9496a6f744ff38249b1a572084d45e45b808ccdb. --- soc/nordic/common/dmm.c | 2 ++ soc/nordic/common/dmm.h | 13 ------------- soc/nordic/nrf54h/soc.c | 8 -------- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/soc/nordic/common/dmm.c b/soc/nordic/common/dmm.c index cfb3f3ad25f..03d1e17875a 100644 --- a/soc/nordic/common/dmm.c +++ b/soc/nordic/common/dmm.c @@ -295,3 +295,5 @@ int dmm_init(void) return 0; } + +SYS_INIT(dmm_init, POST_KERNEL, 0); diff --git a/soc/nordic/common/dmm.h b/soc/nordic/common/dmm.h index e92f01d07b8..b4f478ca073 100644 --- a/soc/nordic/common/dmm.h +++ b/soc/nordic/common/dmm.h @@ -155,14 +155,6 @@ int dmm_buffer_in_prepare(void *region, void *user_buffer, size_t user_length, v */ int dmm_buffer_in_release(void *region, void *user_buffer, size_t user_length, void *buffer_in); -/** - * @brief Initialize DMM. - * - * @retval 0 If succeeded. - * @retval -errno Negative errno code on failure. - */ -int dmm_init(void); - /** @endcond */ #else @@ -202,11 +194,6 @@ static ALWAYS_INLINE int dmm_buffer_in_release(void *region, void *user_buffer, return 0; } -static ALWAYS_INLINE int dmm_init(void) -{ - return 0; -} - #endif #ifdef __cplusplus diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index b93658b55d4..9c27e7b2199 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -19,7 +19,6 @@ #include #include #include -#include LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); @@ -129,8 +128,6 @@ bool z_arm_on_enter_cpu_idle(void) static int nordicsemi_nrf54h_init(void) { - int err; - sys_cache_instr_enable(); sys_cache_data_enable(); @@ -138,11 +135,6 @@ static int nordicsemi_nrf54h_init(void) trim_hsfll(); - err = dmm_init(); - if (err < 0) { - return err; - } - #if DT_NODE_HAS_STATUS(DT_NODELABEL(ccm030), okay) /* DMASEC is set to non-secure by default, which prevents CCM from * accessing secure memory. Change DMASEC to secure. From 1dd2489e6d02f366452806a5043c560d78233eab Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 036/825] Revert "[nrf fromtree] tests: drivers: spi: spi_controller_peripheral: Fix nrf54h20_cpurad" This reverts commit f298a48bf0ade3a74794f41437cac549c7544345. --- .../boards/nrf54h20dk_nrf54h20_cpurad.overlay | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpurad.overlay index 73ec4c1dc08..84edfb2b6f1 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpurad.overlay +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -5,11 +5,6 @@ */ #include "nrf54h20dk_nrf54h20_common.dtsi" -/* Increase dma region to fit dmm heap. */ -&cpurad_dma_region { - reg = <0x1e80 0x100>; -}; - &spi130 { memory-regions = <&cpurad_dma_region>; }; From 55a18cfcfc1c2a7f9838937a5c4eff8aeed0f49f Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 037/825] Revert "[nrf fromtree] soc: nordic: common: dmm: fix region alignment getter" This reverts commit 51ade2a07fdadb0d07c66a7ad877ee39223fcd90. --- soc/nordic/common/dmm.c | 2 +- soc/nordic/common/dmm.h | 24 +++++++++--------------- tests/boards/nrf/dmm/src/main.c | 5 ----- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/soc/nordic/common/dmm.c b/soc/nordic/common/dmm.c index 03d1e17875a..4206870d794 100644 --- a/soc/nordic/common/dmm.c +++ b/soc/nordic/common/dmm.c @@ -23,7 +23,7 @@ {.dt_addr = DT_REG_ADDR(node_id), \ .dt_size = DT_REG_SIZE(node_id), \ .dt_attr = DT_PROP(node_id, zephyr_memory_attr), \ - .dt_align = DMM_REG_ALIGN_SIZE(node_id), \ + .dt_align = DMM_ALIGN_SIZE(node_id), \ .dt_allc = &_BUILD_LINKER_END_VAR(node_id)}, /* Generate declarations of linker variables used to determine size of preallocated variables diff --git a/soc/nordic/common/dmm.h b/soc/nordic/common/dmm.h index b4f478ca073..a1a17e599ea 100644 --- a/soc/nordic/common/dmm.h +++ b/soc/nordic/common/dmm.h @@ -23,24 +23,19 @@ extern "C" { /** @cond INTERNAL_HIDDEN */ -/* Determine if memory region is cacheable. */ -#define DMM_IS_REG_CACHEABLE(node_id) \ - COND_CODE_1(CONFIG_DCACHE, \ - (COND_CODE_1(DT_NODE_HAS_PROP(node_id, zephyr_memory_attr), \ - ((DT_PROP(node_id, zephyr_memory_attr) & DT_MEM_CACHEABLE)), \ +/* Determine if memory region for the peripheral is cacheable. */ +#define DMM_IS_REG_CACHEABLE(node_id) \ + COND_CODE_1(CONFIG_DCACHE, \ + (COND_CODE_1(DT_NODE_HAS_PROP(DT_PHANDLE(node_id, memory_regions), zephyr_memory_attr), \ + (DT_PROP(DT_PHANDLE(node_id, memory_regions), zephyr_memory_attr) & DT_MEM_CACHEABLE), \ (0))), (0)) -/* Determine required alignment of the data buffers in specified memory region. - * Cache line alignment is required if region is cacheable and data cache is enabled. +/* Determine required alignment of the static buffers in memory regions. Cache line alignment is + * required if region is cacheable and data cache is enabled. */ -#define DMM_REG_ALIGN_SIZE(node_id) \ +#define DMM_ALIGN_SIZE(node_id) \ (DMM_IS_REG_CACHEABLE(node_id) ? CONFIG_DCACHE_LINE_SIZE : sizeof(uint8_t)) -/* Determine required alignment of the data buffers in memory region - * associated with specified device node. - */ -#define DMM_ALIGN_SIZE(node_id) DMM_REG_ALIGN_SIZE(DT_PHANDLE(node_id, memory_regions)) - /** * @brief Get reference to memory region associated with the specified device node * @@ -51,7 +46,6 @@ extern "C" { #define DMM_DEV_TO_REG(node_id) \ COND_CODE_1(DT_NODE_HAS_PROP(node_id, memory_regions), \ ((void *)DT_REG_ADDR(DT_PHANDLE(node_id, memory_regions))), (NULL)) - /** * @brief Preallocate buffer in memory region associated with the specified device node * @@ -61,7 +55,7 @@ extern "C" { COND_CODE_1(DT_NODE_HAS_PROP(node_id, memory_regions), \ (__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \ DT_PHANDLE(node_id, memory_regions))))) \ - __aligned(DMM_ALIGN_SIZE(node_id))), \ + __aligned(DMM_ALIGN_SIZE(node_id))), \ ()) #ifdef CONFIG_HAS_NORDIC_DMM diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index 078edcdd39f..b21eeb97e02 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -23,11 +23,6 @@ COND_CODE_1(DT_NODE_HAS_PROP(node_id, memory_regions), \ (DT_REG_SIZE(DT_PHANDLE(node_id, memory_regions))), (0)) -#if CONFIG_DCACHE -BUILD_ASSERT(DMM_ALIGN_SIZE(DUT_CACHE) == CONFIG_DCACHE_LINE_SIZE); -BUILD_ASSERT(DMM_ALIGN_SIZE(DUT_NOCACHE) == 1); -#endif - struct dmm_test_region { void *mem_reg; uintptr_t start; From 7f23564f2590526810a6c752ae92dfda022f3026 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 038/825] Revert "[nrf fromtree] soc: nordic: nrf54h: DMM shall be applied only to rad&app" This reverts commit f1efab82b3a745f834758cf2098811b1e0fb4ab5. --- soc/nordic/nrf54h/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index b01996189b5..4a812b879d0 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -7,6 +7,7 @@ config SOC_SERIES_NRF54HX select HAS_NRFS select HAS_NRFX select HAS_NORDIC_DRIVERS + select HAS_NORDIC_DMM config SOC_NRF54H20_CPUAPP select ARM @@ -18,7 +19,6 @@ config SOC_NRF54H20_CPUAPP select CPU_HAS_ICACHE select CPU_HAS_FPU select CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS - select HAS_NORDIC_DMM select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE select NRFS_HAS_CLOCK_SERVICE select NRFS_HAS_DVFS_SERVICE @@ -42,7 +42,6 @@ config SOC_NRF54H20_CPURAD select NRFS_HAS_CLOCK_SERVICE select NRFS_HAS_MRAM_SERVICE select NRFS_HAS_TEMP_SERVICE - select HAS_NORDIC_DMM select HAS_PM select HAS_POWEROFF From 9d1e9b803afff5f524040c43e0b9788211fa8067 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 039/825] Revert "[nrf fromtree] tests: boards: nrf: dmm: Adjust test to dmm changes" This reverts commit 01be37da5fa241846cde14061a163df799ab7825. --- tests/boards/nrf/dmm/src/main.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index b21eeb97e02..5ddbebfb838 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -74,7 +74,7 @@ static bool dmm_buffer_in_region_check(struct dmm_test_region *dtr, void *buf, s } static void dmm_check_output_buffer(struct dmm_test_region *dtr, uint32_t *fill_value, - void *data, size_t size, bool was_prealloc, bool is_cached) + void *data, size_t size, bool was_prealloc) { void *buf; int retval; @@ -82,9 +82,7 @@ static void dmm_check_output_buffer(struct dmm_test_region *dtr, uint32_t *fill_ memset(data, (*fill_value)++, size); retval = dmm_buffer_out_prepare(dtr->mem_reg, data, size, &buf); zassert_ok(retval); - if (IS_ENABLED(CONFIG_DCACHE) && is_cached) { - zassert_true(IS_ALIGNED(buf, CONFIG_DCACHE_LINE_SIZE)); - } + zassert_true(IS_ALIGNED(buf, DMM_DCACHE_LINE_SIZE)); if (IS_ENABLED(CONFIG_HAS_NORDIC_DMM)) { if (was_prealloc) { @@ -114,9 +112,7 @@ static void dmm_check_input_buffer(struct dmm_test_region *dtr, uint32_t *fill_v retval = dmm_buffer_in_prepare(dtr->mem_reg, data, size, &buf); zassert_ok(retval); - if (IS_ENABLED(CONFIG_DCACHE) && is_cached) { - zassert_true(IS_ALIGNED(buf, CONFIG_DCACHE_LINE_SIZE)); - } + zassert_true(IS_ALIGNED(buf, DMM_DCACHE_LINE_SIZE)); if (IS_ENABLED(CONFIG_HAS_NORDIC_DMM)) { if (was_prealloc) { @@ -166,7 +162,7 @@ ZTEST_USER_F(dmm, test_check_dev_cache_out_allocate) uint8_t user_data[16]; dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, sizeof(user_data), false, true); + user_data, sizeof(user_data), false); } ZTEST_USER_F(dmm, test_check_dev_cache_out_preallocate) @@ -174,7 +170,7 @@ ZTEST_USER_F(dmm, test_check_dev_cache_out_preallocate) static uint8_t user_data[16] DMM_MEMORY_SECTION(DUT_CACHE); dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, sizeof(user_data), true, true); + user_data, sizeof(user_data), true); } ZTEST_USER_F(dmm, test_check_dev_nocache_in_allocate) @@ -198,7 +194,7 @@ ZTEST_USER_F(dmm, test_check_dev_nocache_out_allocate) uint8_t user_data[16]; dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, sizeof(user_data), false, false); + user_data, sizeof(user_data), false); } ZTEST_USER_F(dmm, test_check_dev_nocache_out_preallocate) @@ -206,7 +202,7 @@ ZTEST_USER_F(dmm, test_check_dev_nocache_out_preallocate) static uint8_t user_data[16] DMM_MEMORY_SECTION(DUT_NOCACHE); dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, sizeof(user_data), true, false); + user_data, sizeof(user_data), true); } ZTEST_SUITE(dmm, NULL, test_setup, NULL, test_cleanup, NULL); From 3daa59857a71a024ce85f120b8d6634d9eb78fab Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 040/825] Revert "[nrf fromtree] soc: nordic: common: dmm: Fix memory utilization" This reverts commit 6766eefb72a70614b912b65bbb0bc525cabbc648. --- soc/nordic/common/dmm.c | 10 ++++------ soc/nordic/common/dmm.h | 18 ++++-------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/soc/nordic/common/dmm.c b/soc/nordic/common/dmm.c index 4206870d794..85f18dfa7e8 100644 --- a/soc/nordic/common/dmm.c +++ b/soc/nordic/common/dmm.c @@ -23,7 +23,6 @@ {.dt_addr = DT_REG_ADDR(node_id), \ .dt_size = DT_REG_SIZE(node_id), \ .dt_attr = DT_PROP(node_id, zephyr_memory_attr), \ - .dt_align = DMM_ALIGN_SIZE(node_id), \ .dt_allc = &_BUILD_LINKER_END_VAR(node_id)}, /* Generate declarations of linker variables used to determine size of preallocated variables @@ -37,7 +36,6 @@ struct dmm_region { uintptr_t dt_addr; size_t dt_size; uint32_t dt_attr; - uint32_t dt_align; void *dt_allc; }; @@ -93,7 +91,7 @@ static bool is_user_buffer_correctly_preallocated(void const *user_buffer, size_ return true; } - if (IS_ALIGNED(addr, region->dt_align)) { + if (IS_ALIGNED(addr, DMM_DCACHE_LINE_SIZE)) { /* If buffer is in cacheable region it must be aligned to data cache line size. */ return true; } @@ -103,7 +101,7 @@ static bool is_user_buffer_correctly_preallocated(void const *user_buffer, size_ static size_t dmm_heap_start_get(struct dmm_heap *dh) { - return ROUND_UP(dh->region->dt_allc, dh->region->dt_align); + return ROUND_UP(dh->region->dt_allc, DMM_DCACHE_LINE_SIZE); } static size_t dmm_heap_size_get(struct dmm_heap *dh) @@ -113,8 +111,8 @@ static size_t dmm_heap_size_get(struct dmm_heap *dh) static void *dmm_buffer_alloc(struct dmm_heap *dh, size_t length) { - length = ROUND_UP(length, dh->region->dt_align); - return sys_heap_aligned_alloc(&dh->heap, dh->region->dt_align, length); + length = ROUND_UP(length, DMM_DCACHE_LINE_SIZE); + return sys_heap_aligned_alloc(&dh->heap, DMM_DCACHE_LINE_SIZE, length); } static void dmm_buffer_free(struct dmm_heap *dh, void *buffer) diff --git a/soc/nordic/common/dmm.h b/soc/nordic/common/dmm.h index a1a17e599ea..03780f37239 100644 --- a/soc/nordic/common/dmm.h +++ b/soc/nordic/common/dmm.h @@ -14,7 +14,6 @@ #include #include #include -#include #include #ifdef __cplusplus @@ -23,18 +22,8 @@ extern "C" { /** @cond INTERNAL_HIDDEN */ -/* Determine if memory region for the peripheral is cacheable. */ -#define DMM_IS_REG_CACHEABLE(node_id) \ - COND_CODE_1(CONFIG_DCACHE, \ - (COND_CODE_1(DT_NODE_HAS_PROP(DT_PHANDLE(node_id, memory_regions), zephyr_memory_attr), \ - (DT_PROP(DT_PHANDLE(node_id, memory_regions), zephyr_memory_attr) & DT_MEM_CACHEABLE), \ - (0))), (0)) - -/* Determine required alignment of the static buffers in memory regions. Cache line alignment is - * required if region is cacheable and data cache is enabled. - */ -#define DMM_ALIGN_SIZE(node_id) \ - (DMM_IS_REG_CACHEABLE(node_id) ? CONFIG_DCACHE_LINE_SIZE : sizeof(uint8_t)) +#define DMM_DCACHE_LINE_SIZE \ + COND_CODE_1(IS_ENABLED(CONFIG_DCACHE), (CONFIG_DCACHE_LINE_SIZE), (sizeof(uint8_t))) /** * @brief Get reference to memory region associated with the specified device node @@ -46,6 +35,7 @@ extern "C" { #define DMM_DEV_TO_REG(node_id) \ COND_CODE_1(DT_NODE_HAS_PROP(node_id, memory_regions), \ ((void *)DT_REG_ADDR(DT_PHANDLE(node_id, memory_regions))), (NULL)) + /** * @brief Preallocate buffer in memory region associated with the specified device node * @@ -55,7 +45,7 @@ extern "C" { COND_CODE_1(DT_NODE_HAS_PROP(node_id, memory_regions), \ (__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \ DT_PHANDLE(node_id, memory_regions))))) \ - __aligned(DMM_ALIGN_SIZE(node_id))), \ + __aligned(DMM_DCACHE_LINE_SIZE)), \ ()) #ifdef CONFIG_HAS_NORDIC_DMM From a3f9f9affb338d5e4266fb01b880b0c77f53cf73 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 041/825] Revert "[nrf fromtree] tests: boards: nrf: add tests for dmm component" This reverts commit 121b4dbd725756add965fa94dc5162010c228b08. --- tests/boards/nrf/dmm/CMakeLists.txt | 10 - .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 56 ----- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 58 ----- tests/boards/nrf/dmm/prj.conf | 1 - tests/boards/nrf/dmm/src/main.c | 222 ------------------ tests/boards/nrf/dmm/testcase.yaml | 18 -- 6 files changed, 365 deletions(-) delete mode 100644 tests/boards/nrf/dmm/CMakeLists.txt delete mode 100644 tests/boards/nrf/dmm/boards/nrf5340dk_nrf5340_cpuapp.overlay delete mode 100644 tests/boards/nrf/dmm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay delete mode 100644 tests/boards/nrf/dmm/prj.conf delete mode 100644 tests/boards/nrf/dmm/src/main.c delete mode 100644 tests/boards/nrf/dmm/testcase.yaml diff --git a/tests/boards/nrf/dmm/CMakeLists.txt b/tests/boards/nrf/dmm/CMakeLists.txt deleted file mode 100644 index 3d047c94898..00000000000 --- a/tests/boards/nrf/dmm/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) - -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(dmm) - -FILE(GLOB app_sources src/*.c) - -target_sources(app PRIVATE ${app_sources}) diff --git a/tests/boards/nrf/dmm/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/boards/nrf/dmm/boards/nrf5340dk_nrf5340_cpuapp.overlay deleted file mode 100644 index 9d2eceba667..00000000000 --- a/tests/boards/nrf/dmm/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ /dev/null @@ -1,56 +0,0 @@ -/ { - aliases { - dut-cache = &spi1; - dut-nocache= &spi3; - }; -}; - -&pinctrl { - spi1_default_alt: spi1_default_alt { - group1 { - psels = , - ; - }; - }; - - spi1_sleep_alt: spi1_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - spi3_default_alt: spi3_default_alt { - group1 { - psels = , - ; - }; - }; - - spi3_sleep_alt: spi3_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&spi1 -{ - compatible = "nordic,nrf-spim"; - status = "okay"; - pinctrl-0 = <&spi1_default_alt>; - pinctrl-1 = <&spi1_sleep_alt>; - pinctrl-names = "default", "sleep"; -}; - -&spi3 -{ - compatible = "nordic,nrf-spim"; - status = "okay"; - pinctrl-0 = <&spi3_default_alt>; - pinctrl-1 = <&spi3_sleep_alt>; - pinctrl-names = "default", "sleep"; -}; diff --git a/tests/boards/nrf/dmm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/boards/nrf/dmm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 513ef21776f..00000000000 --- a/tests/boards/nrf/dmm/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,58 +0,0 @@ -/ { - aliases { - dut-cache = &spi120; - dut-nocache = &spi130; - }; -}; - -&pinctrl { - spi130_default_alt: spi130_default_alt { - group1 { - psels = , - ; - }; - }; - - spi130_sleep_alt: spi130_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - spi120_default_alt: spi120_default_alt { - group1 { - psels = , - ; - }; - }; - - spi120_sleep_alt: spi120_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&spi130 -{ - compatible = "nordic,nrf-spim"; - status = "okay"; - pinctrl-0 = <&spi130_default_alt>; - pinctrl-1 = <&spi130_sleep_alt>; - pinctrl-names = "default", "sleep"; - memory-regions = <&cpuapp_dma_region>; -}; - -&spi120 -{ - compatible = "nordic,nrf-spim"; - status = "okay"; - pinctrl-0 = <&spi120_default_alt>; - pinctrl-1 = <&spi120_sleep_alt>; - pinctrl-names = "default", "sleep"; - memory-regions = <&dma_fast_region>; -}; diff --git a/tests/boards/nrf/dmm/prj.conf b/tests/boards/nrf/dmm/prj.conf deleted file mode 100644 index 9467c292689..00000000000 --- a/tests/boards/nrf/dmm/prj.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_ZTEST=y diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c deleted file mode 100644 index 5ddbebfb838..00000000000 --- a/tests/boards/nrf/dmm/src/main.c +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include - -#include - -#define DUT_CACHE DT_ALIAS(dut_cache) -#define DUT_NOCACHE DT_ALIAS(dut_nocache) - -#define DMM_TEST_GET_REG_START(node_id) \ - COND_CODE_1(DT_NODE_HAS_PROP(node_id, memory_regions), \ - (DT_REG_ADDR(DT_PHANDLE(node_id, memory_regions))), (0)) - -#define DMM_TEST_GET_REG_SIZE(node_id) \ - COND_CODE_1(DT_NODE_HAS_PROP(node_id, memory_regions), \ - (DT_REG_SIZE(DT_PHANDLE(node_id, memory_regions))), (0)) - -struct dmm_test_region { - void *mem_reg; - uintptr_t start; - size_t size; -}; - -enum { - DMM_TEST_REGION_CACHE, - DMM_TEST_REGION_NOCACHE, - DMM_TEST_REGION_COUNT -}; - -struct dmm_fixture { - struct dmm_test_region regions[DMM_TEST_REGION_COUNT]; - uint32_t fill_value; -}; - -static const struct dmm_test_region dmm_test_regions[DMM_TEST_REGION_COUNT] = { - [DMM_TEST_REGION_CACHE] = { - .mem_reg = DMM_DEV_TO_REG(DUT_CACHE), - .start = DMM_TEST_GET_REG_START(DUT_CACHE), - .size = DMM_TEST_GET_REG_SIZE(DUT_CACHE) - }, - [DMM_TEST_REGION_NOCACHE] = { - .mem_reg = DMM_DEV_TO_REG(DUT_NOCACHE), - .start = DMM_TEST_GET_REG_START(DUT_NOCACHE), - .size = DMM_TEST_GET_REG_SIZE(DUT_NOCACHE) - }, -}; - -static void *test_setup(void) -{ - static struct dmm_fixture fixture; - - memcpy(fixture.regions, dmm_test_regions, sizeof(dmm_test_regions)); - fixture.fill_value = 0x1; - return &fixture; -} - -static void test_cleanup(void *argc) -{ -} - -static bool dmm_buffer_in_region_check(struct dmm_test_region *dtr, void *buf, size_t size) -{ - uintptr_t start = (uintptr_t)buf; - - return ((start >= dtr->start) && ((start + size) <= (dtr->start + dtr->size))); -} - -static void dmm_check_output_buffer(struct dmm_test_region *dtr, uint32_t *fill_value, - void *data, size_t size, bool was_prealloc) -{ - void *buf; - int retval; - - memset(data, (*fill_value)++, size); - retval = dmm_buffer_out_prepare(dtr->mem_reg, data, size, &buf); - zassert_ok(retval); - zassert_true(IS_ALIGNED(buf, DMM_DCACHE_LINE_SIZE)); - - if (IS_ENABLED(CONFIG_HAS_NORDIC_DMM)) { - if (was_prealloc) { - zassert_equal(data, buf); - } else { - zassert_not_equal(data, buf); - } - zassert_true(dmm_buffer_in_region_check(dtr, buf, size)); - } else { - zassert_equal(data, buf); - } - sys_cache_data_invd_range(buf, size); - zassert_mem_equal(buf, data, size); - - retval = dmm_buffer_out_release(dtr->mem_reg, buf); - zassert_ok(retval); -} - -static void dmm_check_input_buffer(struct dmm_test_region *dtr, uint32_t *fill_value, - void *data, size_t size, bool was_prealloc, bool is_cached) -{ - void *buf; - int retval; - uint8_t intermediate_buf[128]; - - zassert_true(size < sizeof(intermediate_buf)); - - retval = dmm_buffer_in_prepare(dtr->mem_reg, data, size, &buf); - zassert_ok(retval); - zassert_true(IS_ALIGNED(buf, DMM_DCACHE_LINE_SIZE)); - - if (IS_ENABLED(CONFIG_HAS_NORDIC_DMM)) { - if (was_prealloc) { - zassert_equal(data, buf); - } else { - zassert_not_equal(data, buf); - } - zassert_true(dmm_buffer_in_region_check(dtr, buf, size)); - } else { - zassert_equal(data, buf); - } - - /* Simulate external bus master writing to memory region */ - memset(buf, (*fill_value)++, size); - sys_cache_data_flush_range(buf, size); - /* Preserve actual memory region contents before polluting the cache */ - memcpy(intermediate_buf, buf, size); - if (IS_ENABLED(CONFIG_DCACHE) && is_cached) { - /* Purposefully pollute the cache to make sure library manages cache properly */ - memset(buf, (*fill_value)++, size); - } - - retval = dmm_buffer_in_release(dtr->mem_reg, data, size, buf); - zassert_ok(retval); - - zassert_mem_equal(data, intermediate_buf, size); -} - -ZTEST_USER_F(dmm, test_check_dev_cache_in_allocate) -{ - uint8_t user_data[16]; - - dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, sizeof(user_data), false, true); -} - -ZTEST_USER_F(dmm, test_check_dev_cache_in_preallocate) -{ - static uint8_t user_data[16] DMM_MEMORY_SECTION(DUT_CACHE); - - dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, sizeof(user_data), true, true); -} - -ZTEST_USER_F(dmm, test_check_dev_cache_out_allocate) -{ - uint8_t user_data[16]; - - dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, sizeof(user_data), false); -} - -ZTEST_USER_F(dmm, test_check_dev_cache_out_preallocate) -{ - static uint8_t user_data[16] DMM_MEMORY_SECTION(DUT_CACHE); - - dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, sizeof(user_data), true); -} - -ZTEST_USER_F(dmm, test_check_dev_nocache_in_allocate) -{ - uint8_t user_data[16]; - - dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, sizeof(user_data), false, false); -} - -ZTEST_USER_F(dmm, test_check_dev_nocache_in_preallocate) -{ - static uint8_t user_data[16] DMM_MEMORY_SECTION(DUT_NOCACHE); - - dmm_check_input_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, sizeof(user_data), true, false); -} - -ZTEST_USER_F(dmm, test_check_dev_nocache_out_allocate) -{ - uint8_t user_data[16]; - - dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, sizeof(user_data), false); -} - -ZTEST_USER_F(dmm, test_check_dev_nocache_out_preallocate) -{ - static uint8_t user_data[16] DMM_MEMORY_SECTION(DUT_NOCACHE); - - dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, sizeof(user_data), true); -} - -ZTEST_SUITE(dmm, NULL, test_setup, NULL, test_cleanup, NULL); - -int dmm_test_prepare(void) -{ - const struct dmm_test_region *dtr; - - for (size_t i = 0; i < ARRAY_SIZE(dmm_test_regions); i++) { - dtr = &dmm_test_regions[i]; - memset((void *)dtr->start, 0x00, dtr->size); - } - - return 0; -} - -SYS_INIT(dmm_test_prepare, PRE_KERNEL_1, 0); diff --git a/tests/boards/nrf/dmm/testcase.yaml b/tests/boards/nrf/dmm/testcase.yaml deleted file mode 100644 index b5f41f281a5..00000000000 --- a/tests/boards/nrf/dmm/testcase.yaml +++ /dev/null @@ -1,18 +0,0 @@ -common: - tags: drivers - harness: ztest - -tests: - boards.nrf.dmm: - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - - nrf5340dk/nrf5340/cpuapp - integration_platforms: - - nrf5340dk/nrf5340/cpuapp - - nrf54h20dk/nrf54h20/cpuapp - - boards.nrf.dmm.cache_disabled: - extra_configs: - - CONFIG_DCACHE=n - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp From 435700c377115dd87b1853bc6f50376c5051747d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 042/825] Revert "[nrf fromtree] soc: nordic: add dmm component" This reverts commit f6a6be8771b217051351d8436c20548647585508. --- soc/nordic/common/CMakeLists.txt | 4 - soc/nordic/common/Kconfig | 3 - soc/nordic/common/dmm.c | 297 ------------------------------- soc/nordic/common/dmm.h | 187 ------------------- soc/nordic/nrf54h/Kconfig | 1 - 5 files changed, 492 deletions(-) delete mode 100644 soc/nordic/common/dmm.c delete mode 100644 soc/nordic/common/dmm.h diff --git a/soc/nordic/common/CMakeLists.txt b/soc/nordic/common/CMakeLists.txt index abf8b80d3fa..805113f53d6 100644 --- a/soc/nordic/common/CMakeLists.txt +++ b/soc/nordic/common/CMakeLists.txt @@ -9,10 +9,6 @@ zephyr_library_sources_ifdef(CONFIG_POWEROFF poweroff.c) zephyr_include_directories(.) -if(CONFIG_HAS_NORDIC_DMM) - zephyr_library_sources(dmm.c) -endif() - if(CONFIG_TFM_PARTITION_PLATFORM) zephyr_library_sources(soc_secure.c) zephyr_library_include_directories( diff --git a/soc/nordic/common/Kconfig b/soc/nordic/common/Kconfig index 8de20c37dd4..54e2356c6af 100644 --- a/soc/nordic/common/Kconfig +++ b/soc/nordic/common/Kconfig @@ -1,7 +1,4 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config HAS_NORDIC_DMM - bool - rsource "vpr/Kconfig" diff --git a/soc/nordic/common/dmm.c b/soc/nordic/common/dmm.c deleted file mode 100644 index 85f18dfa7e8..00000000000 --- a/soc/nordic/common/dmm.c +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include -#include "dmm.h" - -#define _FILTER_MEM(node_id, fn) \ - COND_CODE_1(DT_NODE_HAS_PROP(node_id, zephyr_memory_attr), (fn(node_id)), ()) -#define DT_MEMORY_REGION_FOREACH_STATUS_OKAY_NODE(fn) \ - DT_FOREACH_STATUS_OKAY_NODE_VARGS(_FILTER_MEM, fn) - -#define __BUILD_LINKER_END_VAR(_name) DT_CAT3(__, _name, _end) -#define _BUILD_LINKER_END_VAR(node_id) \ - __BUILD_LINKER_END_VAR(DT_STRING_UNQUOTED(node_id, zephyr_memory_region)) - -#define _BUILD_MEM_REGION(node_id) \ - {.dt_addr = DT_REG_ADDR(node_id), \ - .dt_size = DT_REG_SIZE(node_id), \ - .dt_attr = DT_PROP(node_id, zephyr_memory_attr), \ - .dt_allc = &_BUILD_LINKER_END_VAR(node_id)}, - -/* Generate declarations of linker variables used to determine size of preallocated variables - * stored in memory sections spanning over memory regions. - * These are used to determine memory left for dynamic bounce buffer allocator to work with. - */ -#define _DECLARE_LINKER_VARS(node_id) extern uint32_t _BUILD_LINKER_END_VAR(node_id); -DT_MEMORY_REGION_FOREACH_STATUS_OKAY_NODE(_DECLARE_LINKER_VARS); - -struct dmm_region { - uintptr_t dt_addr; - size_t dt_size; - uint32_t dt_attr; - void *dt_allc; -}; - -struct dmm_heap { - struct sys_heap heap; - const struct dmm_region *region; -}; - -static const struct dmm_region dmm_regions[] = { - DT_MEMORY_REGION_FOREACH_STATUS_OKAY_NODE(_BUILD_MEM_REGION) -}; - -struct { - struct dmm_heap dmm_heaps[ARRAY_SIZE(dmm_regions)]; -} dmm_heaps_data; - -static struct dmm_heap *dmm_heap_find(void *region) -{ - struct dmm_heap *dh; - - for (size_t idx = 0; idx < ARRAY_SIZE(dmm_heaps_data.dmm_heaps); idx++) { - dh = &dmm_heaps_data.dmm_heaps[idx]; - if (dh->region->dt_addr == (uintptr_t)region) { - return dh; - } - } - - return NULL; -} - -static bool is_region_cacheable(const struct dmm_region *region) -{ - return (IS_ENABLED(CONFIG_DCACHE) && (region->dt_attr & DT_MEM_CACHEABLE)); -} - -static bool is_buffer_within_region(uintptr_t start, size_t size, - uintptr_t reg_start, size_t reg_size) -{ - return ((start >= reg_start) && ((start + size) <= (reg_start + reg_size))); -} - -static bool is_user_buffer_correctly_preallocated(void const *user_buffer, size_t user_length, - const struct dmm_region *region) -{ - uintptr_t addr = (uintptr_t)user_buffer; - - if (!is_buffer_within_region(addr, user_length, region->dt_addr, region->dt_size)) { - return false; - } - - if (!is_region_cacheable(region)) { - /* Buffer is contained within non-cacheable region - use it as it is. */ - return true; - } - - if (IS_ALIGNED(addr, DMM_DCACHE_LINE_SIZE)) { - /* If buffer is in cacheable region it must be aligned to data cache line size. */ - return true; - } - - return false; -} - -static size_t dmm_heap_start_get(struct dmm_heap *dh) -{ - return ROUND_UP(dh->region->dt_allc, DMM_DCACHE_LINE_SIZE); -} - -static size_t dmm_heap_size_get(struct dmm_heap *dh) -{ - return (dh->region->dt_size - (dmm_heap_start_get(dh) - dh->region->dt_addr)); -} - -static void *dmm_buffer_alloc(struct dmm_heap *dh, size_t length) -{ - length = ROUND_UP(length, DMM_DCACHE_LINE_SIZE); - return sys_heap_aligned_alloc(&dh->heap, DMM_DCACHE_LINE_SIZE, length); -} - -static void dmm_buffer_free(struct dmm_heap *dh, void *buffer) -{ - sys_heap_free(&dh->heap, buffer); -} - -int dmm_buffer_out_prepare(void *region, void const *user_buffer, size_t user_length, - void **buffer_out) -{ - struct dmm_heap *dh; - - if (user_length == 0) { - /* Assume that zero-length buffers are correct as they are. */ - *buffer_out = (void *)user_buffer; - return 0; - } - - /* Get memory region that specified device can perform DMA transfers from */ - dh = dmm_heap_find(region); - if (dh == NULL) { - return -EINVAL; - } - - /* Check if: - * - provided user buffer is already in correct memory region, - * - provided user buffer is aligned and padded to cache line, - * if it is located in cacheable region. - */ - if (is_user_buffer_correctly_preallocated(user_buffer, user_length, dh->region)) { - /* If yes, assign buffer_out to user_buffer*/ - *buffer_out = (void *)user_buffer; - } else { - /* If no: - * - dynamically allocate buffer in correct memory region that respects cache line - * alignment and padding - */ - *buffer_out = dmm_buffer_alloc(dh, user_length); - /* Return error if dynamic allocation fails */ - if (*buffer_out == NULL) { - return -ENOMEM; - } - /* - copy user buffer contents into allocated buffer */ - memcpy(*buffer_out, user_buffer, user_length); - } - - /* Check if device memory region is cacheable - * If yes, writeback all cache lines associated with output buffer - * (either user or allocated) - */ - if (is_region_cacheable(dh->region)) { - sys_cache_data_flush_range(*buffer_out, user_length); - } - /* If no, no action is needed */ - - return 0; -} - -int dmm_buffer_out_release(void *region, void *buffer_out) -{ - struct dmm_heap *dh; - uintptr_t addr = (uintptr_t)buffer_out; - - /* Get memory region that specified device can perform DMA transfers from */ - dh = dmm_heap_find(region); - if (dh == NULL) { - return -EINVAL; - } - - /* Check if output buffer is contained within memory area - * managed by dynamic memory allocator - */ - if (is_buffer_within_region(addr, 0, dmm_heap_start_get(dh), dmm_heap_size_get(dh))) { - /* If yes, free the buffer */ - dmm_buffer_free(dh, buffer_out); - } - /* If no, no action is needed */ - - return 0; -} - -int dmm_buffer_in_prepare(void *region, void *user_buffer, size_t user_length, void **buffer_in) -{ - struct dmm_heap *dh; - - if (user_length == 0) { - /* Assume that zero-length buffers are correct as they are. */ - *buffer_in = (void *)user_buffer; - return 0; - } - - /* Get memory region that specified device can perform DMA transfers to */ - dh = dmm_heap_find(region); - if (dh == NULL) { - return -EINVAL; - } - - /* Check if: - * - provided user buffer is already in correct memory region, - * - provided user buffer is aligned and padded to cache line, - * if it is located in cacheable region. - */ - if (is_user_buffer_correctly_preallocated(user_buffer, user_length, dh->region)) { - /* If yes, assign buffer_in to user_buffer */ - *buffer_in = user_buffer; - } else { - /* If no, dynamically allocate buffer in correct memory region that respects cache - * line alignment and padding - */ - *buffer_in = dmm_buffer_alloc(dh, user_length); - /* Return error if dynamic allocation fails */ - if (*buffer_in == NULL) { - return -ENOMEM; - } - } - - /* Check if device memory region is cacheable - * If yes, invalidate all cache lines associated with input buffer - * (either user or allocated) to clear potential dirty bits. - */ - if (is_region_cacheable(dh->region)) { - sys_cache_data_invd_range(*buffer_in, user_length); - } - /* If no, no action is needed */ - - return 0; -} - -int dmm_buffer_in_release(void *region, void *user_buffer, size_t user_length, void *buffer_in) -{ - struct dmm_heap *dh; - uintptr_t addr = (uintptr_t)buffer_in; - - /* Get memory region that specified device can perform DMA transfers to, using devicetree */ - dh = dmm_heap_find(region); - if (dh == NULL) { - return -EINVAL; - } - - /* Check if device memory region is cacheable - * If yes, invalidate all cache lines associated with input buffer - * (either user or allocated) - */ - if (is_region_cacheable(dh->region)) { - sys_cache_data_invd_range(buffer_in, user_length); - } - /* If no, no action is needed */ - - /* Check if user buffer and allocated buffer points to the same memory location - * If no, copy allocated buffer to the user buffer - */ - if (buffer_in != user_buffer) { - memcpy(user_buffer, buffer_in, user_length); - } - /* If yes, no action is needed */ - - /* Check if input buffer is contained within memory area - * managed by dynamic memory allocator - */ - if (is_buffer_within_region(addr, 0, dmm_heap_start_get(dh), dmm_heap_size_get(dh))) { - /* If yes, free the buffer */ - dmm_buffer_free(dh, buffer_in); - } - /* If no, no action is needed */ - - return 0; -} - -int dmm_init(void) -{ - struct dmm_heap *dh; - - for (size_t idx = 0; idx < ARRAY_SIZE(dmm_regions); idx++) { - dh = &dmm_heaps_data.dmm_heaps[idx]; - dh->region = &dmm_regions[idx]; - sys_heap_init(&dh->heap, (void *)dmm_heap_start_get(dh), dmm_heap_size_get(dh)); - } - - return 0; -} - -SYS_INIT(dmm_init, POST_KERNEL, 0); diff --git a/soc/nordic/common/dmm.h b/soc/nordic/common/dmm.h deleted file mode 100644 index 03780f37239..00000000000 --- a/soc/nordic/common/dmm.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * nRF SoC specific public APIs for Device Memory Management (dmm) subsystem - */ - -#ifndef SOC_NORDIC_COMMON_DMM_H_ -#define SOC_NORDIC_COMMON_DMM_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** @cond INTERNAL_HIDDEN */ - -#define DMM_DCACHE_LINE_SIZE \ - COND_CODE_1(IS_ENABLED(CONFIG_DCACHE), (CONFIG_DCACHE_LINE_SIZE), (sizeof(uint8_t))) - -/** - * @brief Get reference to memory region associated with the specified device node - * - * @param node_id Device node. - * - * @return Reference to memory region. NULL if not defined for given device node. - */ -#define DMM_DEV_TO_REG(node_id) \ - COND_CODE_1(DT_NODE_HAS_PROP(node_id, memory_regions), \ - ((void *)DT_REG_ADDR(DT_PHANDLE(node_id, memory_regions))), (NULL)) - -/** - * @brief Preallocate buffer in memory region associated with the specified device node - * - * @param node_id Device node. - */ -#define DMM_MEMORY_SECTION(node_id) \ - COND_CODE_1(DT_NODE_HAS_PROP(node_id, memory_regions), \ - (__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \ - DT_PHANDLE(node_id, memory_regions))))) \ - __aligned(DMM_DCACHE_LINE_SIZE)), \ - ()) - -#ifdef CONFIG_HAS_NORDIC_DMM - -/** - * @brief Prepare a DMA output buffer for the specified device - * - * Allocate an output buffer in memory region that given device can perform DMA transfers from. - * Copy @p user_buffer contents into it. - * Writeback data cache lines associated with output buffer, if needed. - * - * @note Depending on provided user buffer parameters and SoC architecture, - * dynamic allocation and cache operations might be skipped. - * - * @note @p buffer_out can be released using @ref dmm_buffer_in_release() - * to support transmitting and receiving data to the same buffer. - * - * @warning It is prohibited to read or write @p user_buffer or @p buffer_out contents - * from the time this function is called until @ref dmm_buffer_out_release() - * or @ref dmm_buffer_in_release is called on the same buffer - * or until this function returns with an error. - * - * @param region Memory region associated with device to prepare the buffer for. - * @param user_buffer CPU address (virtual if applicable) of the buffer containing data - * to be processed by the given device. - * @param user_length Length of the buffer containing data to be processed by the given device. - * @param buffer_out Pointer to a bus address of a buffer containing the prepared DMA buffer. - * - * @retval 0 If succeeded. - * @retval -ENOMEM If output buffer could not be allocated. - * @retval -errno Negative errno for other failures. - */ -int dmm_buffer_out_prepare(void *region, void const *user_buffer, size_t user_length, - void **buffer_out); - -/** - * @brief Release the previously prepared DMA output buffer - * - * @param region Memory region associated with device to release the buffer for. - * @param buffer_out Bus address of the DMA output buffer previously prepared - * with @ref dmm_buffer_out_prepare(). - * - * @retval 0 If succeeded. - * @retval -errno Negative errno code on failure. - */ -int dmm_buffer_out_release(void *region, void *buffer_out); - -/** - * @brief Prepare a DMA input buffer for the specified device - * - * Allocate an input buffer in memory region that given device can perform DMA transfers to. - * - * @note Depending on provided user buffer parameters and SoC architecture, - * dynamic allocation might be skipped. - * - * @warning It is prohibited to read or write @p user_buffer or @p buffer_in contents - * from the time this function is called until @ref dmm_buffer_in_release() - * is called on the same buffer or until this function returns with an error. - * - * @param region Memory region associated with device to prepare the buffer for. - * @param user_buffer CPU address (virtual if applicable) of the buffer to be filled with data - * from the given device. - * @param user_length Length of the buffer to be filled with data from the given device. - * @param buffer_in Pointer to a bus address of a buffer containing the prepared DMA buffer. - * - * @retval 0 If succeeded. - * @retval -ENOMEM If input buffer could not be allocated. - * @retval -errno Negative errno for other failures. - */ -int dmm_buffer_in_prepare(void *region, void *user_buffer, size_t user_length, void **buffer_in); - -/** - * @brief Release the previously prepared DMA input buffer - * - * Invalidate data cache lines associated with input buffer, if needed. - * Copy @p buffer_in contents into @p user_buffer, if needed. - * - * @param region Memory region associated with device to release the buffer for. - * @param user_buffer CPU address (virtual if applicable) of the buffer to be filled with data - * from the given device. - * @param user_length Length of the buffer to be filled with data from the given device. - * @param buffer_in Bus address of the DMA input buffer previously prepared - * with @ref dmm_buffer_in_prepare(). - * - * @note @p user_buffer and @p buffer_in arguments pair provided in this function call must match - * the arguments pair provided in prior call to @ref dmm_buffer_out_prepare() - * or @ref dmm_buffer_in_prepare(). - * - * @retval 0 If succeeded. - * @retval -errno Negative errno code on failure. - */ -int dmm_buffer_in_release(void *region, void *user_buffer, size_t user_length, void *buffer_in); - -/** @endcond */ - -#else - -static ALWAYS_INLINE int dmm_buffer_out_prepare(void *region, void const *user_buffer, - size_t user_length, void **buffer_out) -{ - ARG_UNUSED(region); - ARG_UNUSED(user_length); - *buffer_out = (void *)user_buffer; - return 0; -} - -static ALWAYS_INLINE int dmm_buffer_out_release(void *region, void *buffer_out) -{ - ARG_UNUSED(region); - ARG_UNUSED(buffer_out); - return 0; -} - -static ALWAYS_INLINE int dmm_buffer_in_prepare(void *region, void *user_buffer, size_t user_length, - void **buffer_in) -{ - ARG_UNUSED(region); - ARG_UNUSED(user_length); - *buffer_in = user_buffer; - return 0; -} - -static ALWAYS_INLINE int dmm_buffer_in_release(void *region, void *user_buffer, size_t user_length, - void *buffer_in) -{ - ARG_UNUSED(region); - ARG_UNUSED(user_buffer); - ARG_UNUSED(user_length); - ARG_UNUSED(buffer_in); - return 0; -} - -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* SOC_NORDIC_COMMON_DMM_H_ */ diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 4a812b879d0..a9fe5f9863e 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -7,7 +7,6 @@ config SOC_SERIES_NRF54HX select HAS_NRFS select HAS_NRFX select HAS_NORDIC_DRIVERS - select HAS_NORDIC_DMM config SOC_NRF54H20_CPUAPP select ARM From 9aa038eabca57a4f84a5c38796a1a3044a954d51 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 043/825] Revert "[nrf fromtree] boards: nordic: nrf54h20dk: add DMA attribute to RAM21 & RAM3x" This reverts commit af225cecd014c5fcbba38d947c617640803b4535. --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi index e661beb8350..8afcf1b23cc 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi @@ -127,7 +127,7 @@ status = "disabled"; #memory-region-cells = <0>; zephyr,memory-region = "DMA_RAM21"; - zephyr,memory-attr = <( DT_MEM_DMA | DT_MEM_CACHEABLE )>; + zephyr,memory-attr = <( DT_MEM_CACHEABLE )>; }; }; @@ -171,7 +171,6 @@ status = "disabled"; #memory-region-cells = <0>; zephyr,memory-region = "DMA_RAM3x_APP"; - zephyr,memory-attr = <( DT_MEM_DMA )>; }; cpurad_dma_region: memory@1e80 { @@ -180,7 +179,6 @@ status = "disabled"; #memory-region-cells = <0>; zephyr,memory-region = "DMA_RAM3x_RAD"; - zephyr,memory-attr = <( DT_MEM_DMA )>; }; }; }; From f8e99dfae0ccc34f68c4c05d313a6a54f9a6aadb Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 044/825] Revert "[nrf fromtree] drivers: mbox: nrf_bellboard: only clear events that raised the IRQ" This reverts commit 60472b5d82fc6561d46cda58da0fb463b436c772. --- drivers/mbox/mbox_nrf_bellboard_rx.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/mbox/mbox_nrf_bellboard_rx.c b/drivers/mbox/mbox_nrf_bellboard_rx.c index 54dd21b9624..8b98d361d0c 100644 --- a/drivers/mbox/mbox_nrf_bellboard_rx.c +++ b/drivers/mbox/mbox_nrf_bellboard_rx.c @@ -8,7 +8,6 @@ #include #include #include -#include #include @@ -48,20 +47,11 @@ static void bellboard_rx_isr(const void *parameter) for (uint8_t i = 0U; i < NRF_BELLBOARD_EVENTS_TRIGGERED_COUNT; i++) { nrf_bellboard_event_t event = nrf_bellboard_triggered_event_get(i); - if ((int_pend & BIT(i)) != 0U) { - /* Only clear those events that have their corresponding bit set - * in INTPEND at the time we read it. Otherwise, if two (or more) - * events are generated in quick succession, INTPEND may be set for - * only one of events, but we clear the EVENTS_TRIGGERED bit for - * all of them, thus losing them. - * - * Assume nrf_bellboard_event_check() is true for the event - * that raised this interrupt. - */ - __ASSERT_NO_MSG(nrf_bellboard_event_check(bellboard, event)); - + if (nrf_bellboard_event_check(bellboard, event)) { nrf_bellboard_event_clear(bellboard, event); + } + if ((int_pend & BIT(i)) != 0U) { if (cbs[i] != NULL) { cbs[i](DEVICE_DT_INST_GET(0), i, cbs_ctx[i], NULL); } From 0cb0f9c7fe46f48a8fb921f7dcd3cc5ff8bfc94d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 045/825] Revert "[nrf fromtree] tests: drivers: mbox: Fix for BUS FAULT on nrf54l15" This reverts commit 1ab791d9aafd9bc0e92568a1146402c159d03e60. --- tests/drivers/mbox/mbox_error_cases/sample.yaml | 8 +------- tests/drivers/mbox/mbox_error_cases/src/main.c | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/drivers/mbox/mbox_error_cases/sample.yaml b/tests/drivers/mbox/mbox_error_cases/sample.yaml index 9f61af5e1d2..624fb0097e7 100644 --- a/tests/drivers/mbox/mbox_error_cases/sample.yaml +++ b/tests/drivers/mbox/mbox_error_cases/sample.yaml @@ -9,12 +9,6 @@ tests: platform_allow: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp - - tests.drivers.mbox_error_cases.nrf54l: - platform_allow: - nrf54l15pdk/nrf54l15/cpuapp integration_platforms: - - nrf54l15pdk/nrf54l15/cpuapp - extra_args: SNIPPET=nordic-flpr + - nrf54h20dk/nrf54h20/cpuapp diff --git a/tests/drivers/mbox/mbox_error_cases/src/main.c b/tests/drivers/mbox/mbox_error_cases/src/main.c index 555a89e2883..81eb3e656a7 100644 --- a/tests/drivers/mbox/mbox_error_cases/src/main.c +++ b/tests/drivers/mbox/mbox_error_cases/src/main.c @@ -450,7 +450,7 @@ ZTEST(mbox_error_cases, test_05c_mbox_set_enabled_on_already_enabled_rx_channel) * -EALREADY when user tries to disable already disabled RX mbox channel. * */ -ZTEST(mbox_error_cases, test_05d_mbox_set_disable_on_already_disabled_rx_channel) +ZTEST(mbox_error_cases, test_05d_mbox_set_enabled_on_already_disabled_rx_channel) { const struct mbox_dt_spec rx_channel = MBOX_DT_SPEC_GET(DT_PATH(mbox_consumer), local_valid); From 2ff6389408a836a0dc61aa752ac11bdeadb5b4d3 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 046/825] Revert "[nrf fromlist] boards: nrf54h20dk: Fix settings partition" This reverts commit d3a967f7b8696e5e05a1ff64be49561a58e9e13d. --- .../nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi index 8afcf1b23cc..0d79ea5b556 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi @@ -227,11 +227,11 @@ #size-cells = <1>; dfu_partition: partition@100000 { - reg = < 0x100000 DT_SIZE_K(908) >; + reg = < 0x100000 DT_SIZE_K(892) >; }; - storage_partition: partition@1e3000 { - reg = < 0x1e3000 DT_SIZE_K(24) >; + storage_partition: partition@1df000 { + reg = < 0x1df000 DT_SIZE_K(24) >; }; }; }; From 720a07775c562c112ec19bed19de87e14a91995a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 047/825] Revert "[nrf fromtree] samples: drivers: Enable SPI MEMORY driver samples for nrfl54l15" This reverts commit 78f654738d488e96e4d2107cec538347c3f0fce0. --- .../jesd216/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay | 9 --------- .../spi_flash/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay | 9 --------- 2 files changed, 18 deletions(-) delete mode 100644 samples/drivers/jesd216/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/drivers/spi_flash/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay diff --git a/samples/drivers/jesd216/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/drivers/jesd216/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index fb87b49cc22..00000000000 --- a/samples/drivers/jesd216/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/drivers/spi_flash/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/drivers/spi_flash/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index fb87b49cc22..00000000000 --- a/samples/drivers/spi_flash/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&mx25r64 { - status = "okay"; -}; From 17d074c4495664b30791dbd14ac80ebaa9caeccc Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 048/825] Revert "[nrf fromtree] tests: bsim: run_parallel: Avoid escape sequences in xml" This reverts commit 21646b971a401660a008920d14d02f7956b13d5f. --- tests/bsim/run_parallel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bsim/run_parallel.sh b/tests/bsim/run_parallel.sh index b9c22630e53..0a96229e59b 100755 --- a/tests/bsim/run_parallel.sh +++ b/tests/bsim/run_parallel.sh @@ -70,7 +70,7 @@ echo "Attempting to run ${n_cases} cases (logging to \ `realpath ${RESULTS_FILE}`)" export CLEAN_XML="sed -E -e 's/&/\&/g' -e 's//\>/g' \ - -e 's/\"/"/g' -e $'s/\x1b\[[0-9;]*[a-zA-Z]//g'" + -e 's/\"/"/g'" echo -n "" > $tmp_res_file From 2fa06c66bb8d77729381d53233bf5bcbdff1c2a8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 049/825] Revert "[nrf fromtree] manifest: Update nRF hw models to latest" This reverts commit eb350f8eaf161d4654635a78cffb3257aa51a009. --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 746c8b9655c..1da99e5545c 100644 --- a/west.yml +++ b/west.yml @@ -295,7 +295,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: d2a119a9c7600ce06033a794de042e0ad9a38702 + revision: 4b0b020e25dbf1a11ccccf7b7741d6ca991ba9e4 path: modules/bsim_hw_models/nrf_hw_models - name: open-amp revision: da78aea63159771956fe0c9263f2e6985b66e9d5 From 253e343976e45d7a618b8e6c314563d9ba34bc9a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 050/825] Revert "[nrf fromtree] board: nrf54l15bsim: Disable native_posix entropy seeding" This reverts commit 18ed9ba67b286330d4c035de0c221b90896ccebb. --- boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp_defconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp_defconfig b/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp_defconfig index c8f804a2005..0fde4e01b58 100644 --- a/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp_defconfig +++ b/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp_defconfig @@ -6,5 +6,3 @@ CONFIG_NO_OPTIMIZATIONS=y # Start SYSCOUNTER on driver init CONFIG_NRF_GRTC_START_SYSCOUNTER=y - -CONFIG_FAKE_ENTROPY_NATIVE_POSIX_SEED_BY_DEFAULT=n From 07a0557c5e1993fa0da4efc81045f533b3ea3bb5 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 051/825] Revert "[nrf fromtree] entropy: native_posix: Add kconfig to not seed by default" This reverts commit e0ee60863c6a07384d11412d951a46539b5f38f2. --- drivers/entropy/Kconfig.native_posix | 9 --------- drivers/entropy/fake_entropy_native_posix.c | 14 +------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/drivers/entropy/Kconfig.native_posix b/drivers/entropy/Kconfig.native_posix index 39298c444df..94fd7300670 100644 --- a/drivers/entropy/Kconfig.native_posix +++ b/drivers/entropy/Kconfig.native_posix @@ -12,12 +12,3 @@ config FAKE_ENTROPY_NATIVE_POSIX not generate real entropy. It actually generates always the same sequence of random numbers if initialized with the same seed. - -config FAKE_ENTROPY_NATIVE_POSIX_SEED_BY_DEFAULT - bool "Seed the generator by default" - default y - depends on FAKE_ENTROPY_NATIVE_POSIX - help - Apply a seed by default, even if the user does not request it through the command line. - Disabling this feature allows some other component to seed the host standard library random - generator without this component's default initialization interfering. diff --git a/drivers/entropy/fake_entropy_native_posix.c b/drivers/entropy/fake_entropy_native_posix.c index e9ee4ab9284..ccdd3aa46e5 100644 --- a/drivers/entropy/fake_entropy_native_posix.c +++ b/drivers/entropy/fake_entropy_native_posix.c @@ -27,7 +27,6 @@ static unsigned int seed = 0x5678; static bool seed_random; -static bool seed_set; static int entropy_native_posix_get_entropy(const struct device *dev, uint8_t *buffer, @@ -70,10 +69,7 @@ static int entropy_native_posix_get_entropy_isr(const struct device *dev, static int entropy_native_posix_init(const struct device *dev) { ARG_UNUSED(dev); - if (seed_set || seed_random || - IS_ENABLED(CONFIG_FAKE_ENTROPY_NATIVE_POSIX_SEED_BY_DEFAULT)) { - entropy_native_seed(seed, seed_random); - } + entropy_native_seed(seed, seed_random); posix_print_warning("WARNING: " "Using a test - not safe - entropy source\n"); return 0; @@ -90,13 +86,6 @@ DEVICE_DT_INST_DEFINE(0, PRE_KERNEL_1, CONFIG_ENTROPY_INIT_PRIORITY, &entropy_native_posix_api_funcs); -static void seed_was_set(char *argv, int offset) -{ - ARG_UNUSED(argv); - ARG_UNUSED(offset); - seed_set = true; -} - static void add_fake_entropy_option(void) { static struct args_struct_t entropy_options[] = { @@ -105,7 +94,6 @@ static void add_fake_entropy_option(void) .name = "r_seed", .type = 'u', .dest = (void *)&seed, - .call_when_found = seed_was_set, .descript = "A 32-bit integer seed value for the entropy device, such as " "97229 (decimal), 0x17BCD (hex), or 0275715 (octal)" }, From 9d5f6f0a93518338dbdac4590547f54ce8e27c7a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:51 +0200 Subject: [PATCH 052/825] Revert "[nrf noup] dts: Select SoftDevice Controller DTS binding as default (2)" This reverts commit d066e02a743b6090ec276c22af03184b10b9aa8c. --- 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/nrf54l15_cpuapp.dtsi | 4 +- dts/common/nordic/nrf54h20.dtsi | 7 +- dts/common/nordic/nrf54l15.dtsi | 7 +- samples/bluetooth/beacon/sample.yaml | 4 +- .../broadcast_audio_sink/sample.yaml | 4 +- .../broadcast_audio_sink/sysbuild.cmake | 4 - .../broadcast_audio_source/sample.yaml | 4 +- .../broadcast_audio_source/sysbuild.cmake | 4 - samples/bluetooth/central_iso/sample.yaml | 6 +- .../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_vs_scan_req/sample.yaml | 2 - .../public_broadcast_sink/sample.yaml | 4 +- .../public_broadcast_sink/sysbuild.cmake | 4 - .../public_broadcast_source/sample.yaml | 4 +- .../public_broadcast_source/sysbuild.cmake | 4 - .../unicast_audio_client/sample.yaml | 4 +- .../unicast_audio_client/sysbuild.cmake | 4 - .../unicast_audio_server/sample.yaml | 4 +- .../unicast_audio_server/sysbuild.cmake | 4 - .../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_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_version/testcase.yaml | 2 - tests/bluetooth/ctrl_sw_privacy/testcase.yaml | 2 - tests/bluetooth/ctrl_user_ext/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 +++++------------- 61 files changed, 115 insertions(+), 349 deletions(-) diff --git a/dts/arm/nordic/nrf52805.dtsi b/dts/arm/nordic/nrf52805.dtsi index 2e2239443d4..36213c18652 100644 --- a/dts/arm/nordic/nrf52805.dtsi +++ b/dts/arm/nordic/nrf52805.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; }; @@ -88,13 +88,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 684372da442..18b2e430943 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -5,7 +5,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -92,13 +92,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 bb8fb82ef1a..12615364cef 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.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; }; @@ -104,13 +104,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 23a4c58db79..21bb88aa99c 100644 --- a/dts/arm/nordic/nrf52820.dtsi +++ b/dts/arm/nordic/nrf52820.dtsi @@ -10,7 +10,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -100,13 +100,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 22eca653d96..f467c5fc5c0 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -5,7 +5,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -92,13 +92,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 19c5fc71b5b..1a27a14447b 100644 --- a/dts/arm/nordic/nrf52833.dtsi +++ b/dts/arm/nordic/nrf52833.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; }; @@ -99,13 +99,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 bd59fa8c50d..a808e59afcf 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -5,7 +5,7 @@ / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -94,13 +94,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 0da1e06866f..77b77759b22 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 371b3f5f4ea..9f6f579faeb 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -22,7 +22,7 @@ wdt011: &cpurad_wdt011 {}; / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; }; soc { @@ -102,6 +102,6 @@ wdt011: &cpurad_wdt011 {}; status = "okay"; }; -&bt_hci_sdc { +&bt_hci_controller { status = "okay"; }; diff --git a/dts/arm/nordic/nrf54l15_cpuapp.dtsi b/dts/arm/nordic/nrf54l15_cpuapp.dtsi index d0d3f8e99c7..707772b309c 100644 --- a/dts/arm/nordic/nrf54l15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l15_cpuapp.dtsi @@ -17,7 +17,7 @@ nvic: &cpuapp_nvic {}; / { chosen { - zephyr,bt-hci = &bt_hci_sdc; + zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &psa_rng; }; @@ -33,7 +33,7 @@ nvic: &cpuapp_nvic {}; }; }; -&bt_hci_sdc { +&bt_hci_controller { status = "okay"; }; diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index c87db0167fa..bbbb2c03d96 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -359,10 +359,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/common/nordic/nrf54l15.dtsi b/dts/common/nordic/nrf54l15.dtsi index a8f7ed21df3..3681a90cc48 100644 --- a/dts/common/nordic/nrf54l15.dtsi +++ b/dts/common/nordic/nrf54l15.dtsi @@ -216,10 +216,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/beacon/sample.yaml b/samples/bluetooth/beacon/sample.yaml index 840a8d5e033..9073de8c1fc 100644 --- a/samples/bluetooth/beacon/sample.yaml +++ b/samples/bluetooth/beacon/sample.yaml @@ -12,9 +12,7 @@ tests: - qemu_cortex_m3 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 tags: bluetooth diff --git a/samples/bluetooth/broadcast_audio_sink/sample.yaml b/samples/bluetooth/broadcast_audio_sink/sample.yaml index f853a0e6117..ef88ecc4bb2 100644 --- a/samples/bluetooth/broadcast_audio_sink/sample.yaml +++ b/samples/bluetooth/broadcast_audio_sink/sample.yaml @@ -24,7 +24,5 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: - - OVERLAY_CONFIG=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: OVERLAY_CONFIG=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/broadcast_audio_sink/sysbuild.cmake b/samples/bluetooth/broadcast_audio_sink/sysbuild.cmake index d5d260789ff..2523aac8ea7 100644 --- a/samples/bluetooth/broadcast_audio_sink/sysbuild.cmake +++ b/samples/bluetooth/broadcast_audio_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/broadcast_audio_source/sample.yaml b/samples/bluetooth/broadcast_audio_source/sample.yaml index 0fcb7e8d357..047323dd3c7 100644 --- a/samples/bluetooth/broadcast_audio_source/sample.yaml +++ b/samples/bluetooth/broadcast_audio_source/sample.yaml @@ -25,7 +25,5 @@ tests: - nrf52_bsim - nrf52833dk/nrf52833 - nrf52840dongle/nrf52840 - extra_args: - - OVERLAY_CONFIG=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: OVERLAY_CONFIG=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/broadcast_audio_source/sysbuild.cmake b/samples/bluetooth/broadcast_audio_source/sysbuild.cmake index d5d260789ff..2523aac8ea7 100644 --- a/samples/bluetooth/broadcast_audio_source/sysbuild.cmake +++ b/samples/bluetooth/broadcast_audio_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/central_iso/sample.yaml b/samples/bluetooth/central_iso/sample.yaml index bab8af1ba7c..455ff8fcb00 100644 --- a/samples/bluetooth/central_iso/sample.yaml +++ b/samples/bluetooth/central_iso/sample.yaml @@ -11,11 +11,11 @@ tests: sample.bluetooth.central_iso.bt_ll_sw_split: harness: bluetooth platform_allow: + - qemu_cortex_m3 + - qemu_x86 - nrf52_bsim - nrf52833dk/nrf52833 integration_platforms: - nrf52833dk/nrf52833 - extra_args: - - OVERLAY_CONFIG=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: OVERLAY_CONFIG=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/direction_finding_central/sample.yaml b/samples/bluetooth/direction_finding_central/sample.yaml index c1d1adae2c4..b0c94537b51 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: - - OVERLAY_CONFIG="overlay-aod.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: OVERLAY_CONFIG="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 97d4fea9e69..1c79df41275 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: - - OVERLAY_CONFIG="overlay-aod.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: OVERLAY_CONFIG="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 e1833b9be8a..1ea189f5088 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: - - OVERLAY_CONFIG="overlay-aoa.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: OVERLAY_CONFIG="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 00a8c0b79d1..126355a735f 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: - - OVERLAY_CONFIG="overlay-aoa.conf" - - SNIPPET="bt-ll-sw-split" + extra_args: OVERLAY_CONFIG="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 15d47e6866e..e88726aa45f 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 @@ -28,9 +26,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 @@ -40,9 +36,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 @@ -52,9 +46,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 @@ -64,9 +56,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 @@ -76,9 +66,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 @@ -88,9 +76,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 - nrf5340bsim/nrf5340/cpunet @@ -102,7 +88,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 @@ -113,16 +98,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_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/public_broadcast_sink/sample.yaml b/samples/bluetooth/public_broadcast_sink/sample.yaml index a3265c96660..cf437a73703 100644 --- a/samples/bluetooth/public_broadcast_sink/sample.yaml +++ b/samples/bluetooth/public_broadcast_sink/sample.yaml @@ -23,7 +23,5 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: - - OVERLAY_CONFIG=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: OVERLAY_CONFIG=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/public_broadcast_sink/sysbuild.cmake b/samples/bluetooth/public_broadcast_sink/sysbuild.cmake index d5d260789ff..2523aac8ea7 100644 --- a/samples/bluetooth/public_broadcast_sink/sysbuild.cmake +++ b/samples/bluetooth/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/public_broadcast_source/sample.yaml b/samples/bluetooth/public_broadcast_source/sample.yaml index 243ae339f32..d40c0485557 100644 --- a/samples/bluetooth/public_broadcast_source/sample.yaml +++ b/samples/bluetooth/public_broadcast_source/sample.yaml @@ -23,7 +23,5 @@ tests: integration_platforms: - nrf52_bsim - nrf52833dk/nrf52833 - extra_args: - - OVERLAY_CONFIG=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: OVERLAY_CONFIG=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/public_broadcast_source/sysbuild.cmake b/samples/bluetooth/public_broadcast_source/sysbuild.cmake index e0a7fd9d175..d3bf7be5b6c 100644 --- a/samples/bluetooth/public_broadcast_source/sysbuild.cmake +++ b/samples/bluetooth/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/samples/bluetooth/unicast_audio_client/sample.yaml b/samples/bluetooth/unicast_audio_client/sample.yaml index e69083f2669..536ab9144f0 100644 --- a/samples/bluetooth/unicast_audio_client/sample.yaml +++ b/samples/bluetooth/unicast_audio_client/sample.yaml @@ -22,7 +22,5 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: - - OVERLAY_CONFIG=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: OVERLAY_CONFIG=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/unicast_audio_client/sysbuild.cmake b/samples/bluetooth/unicast_audio_client/sysbuild.cmake index d5d260789ff..2523aac8ea7 100644 --- a/samples/bluetooth/unicast_audio_client/sysbuild.cmake +++ b/samples/bluetooth/unicast_audio_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/unicast_audio_server/sample.yaml b/samples/bluetooth/unicast_audio_server/sample.yaml index 744833234b9..fc14175a2d1 100644 --- a/samples/bluetooth/unicast_audio_server/sample.yaml +++ b/samples/bluetooth/unicast_audio_server/sample.yaml @@ -22,7 +22,5 @@ tests: - nrf52840dk/nrf52840 integration_platforms: - nrf52dk/nrf52832 - extra_args: - - OVERLAY_CONFIG=overlay-bt_ll_sw_split.conf - - SNIPPET="bt-ll-sw-split" + extra_args: OVERLAY_CONFIG=overlay-bt_ll_sw_split.conf tags: bluetooth diff --git a/samples/bluetooth/unicast_audio_server/sysbuild.cmake b/samples/bluetooth/unicast_audio_server/sysbuild.cmake index d5d260789ff..2523aac8ea7 100644 --- a/samples/bluetooth/unicast_audio_server/sysbuild.cmake +++ b/samples/bluetooth/unicast_audio_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/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_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_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/ctrl_sw_privacy/testcase.yaml b/tests/bluetooth/ctrl_sw_privacy/testcase.yaml index ac5dd6e957e..778606d6954 100644 --- a/tests/bluetooth/ctrl_sw_privacy/testcase.yaml +++ b/tests/bluetooth/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/ctrl_user_ext/testcase.yaml b/tests/bluetooth/ctrl_user_ext/testcase.yaml index be963df24a8..af319a7a719 100644 --- a/tests/bluetooth/ctrl_user_ext/testcase.yaml +++ b/tests/bluetooth/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/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 d0f917f1fe2..69afaaf8b08 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 @@ -159,7 +148,6 @@ 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 @@ -167,36 +155,28 @@ tests: - nrf52840dk/nrf52840 - 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 - nrf51dk/nrf51822 - rv32m1_vega/openisa_rv32m1/ri5cy 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 - nrf51dk/nrf51822 - rv32m1_vega/openisa_rv32m1/ri5cy 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 - nrf51dk/nrf51822 - rv32m1_vega/openisa_rv32m1/ri5cy 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 @@ -207,9 +187,7 @@ tests: - nrf51dk/nrf51822 - rv32m1_vega/openisa_rv32m1/ri5cy 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: - nrf51dk/nrf51822 - 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 @@ -233,9 +209,7 @@ tests: - nrf51dk/nrf51822 - 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 @@ -244,9 +218,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 @@ -255,9 +227,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 @@ -266,9 +236,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 @@ -277,9 +245,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 @@ -288,9 +254,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 @@ -299,9 +263,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 @@ -310,9 +272,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 @@ -321,9 +281,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 @@ -332,9 +290,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 @@ -343,9 +299,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 @@ -354,9 +308,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 @@ -365,9 +317,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 @@ -386,9 +336,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 @@ -401,6 +349,5 @@ tests: extra_args: - CONF_FILE=prj_ctlr.conf - CONFIG_BT_RECV_WORKQ_BT=y - - SNIPPET="bt-ll-sw-split" platform_allow: - nrf52840dk/nrf52840 From 9c5868c5778b31a8db792b510a96fdb6bab98dc8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 053/825] Revert "[nrf noup] modules: hal_nordic: add DPPI channel allocation for NRFE" This reverts commit 6249458d4927bb67e0085ec43549d0e980385d9e. --- modules/hal_nordic/nrfx/nrfe_config.h | 20 -------------------- modules/hal_nordic/nrfx/nrfx_glue.h | 15 ++------------- 2 files changed, 2 insertions(+), 33 deletions(-) delete mode 100644 modules/hal_nordic/nrfx/nrfe_config.h diff --git a/modules/hal_nordic/nrfx/nrfe_config.h b/modules/hal_nordic/nrfx/nrfe_config.h deleted file mode 100644 index c85d22a14a3..00000000000 --- a/modules/hal_nordic/nrfx/nrfe_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2024, Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef NRFE_CONFIG_H__ -#define NRFE_CONFIG_H__ - -#ifdef CONFIG_GPIO_NRFE -#include -#else -#error "NRFE config header included, even though no SW-define IO device is enabled." -#endif - -#ifndef NRFE_RESERVED_PPI_CHANNELS -#define NRFE_RESERVED_PPI_CHANNELS 0 -#endif - -#endif /* NRFE_CONFIG_H__ */ diff --git a/modules/hal_nordic/nrfx/nrfx_glue.h b/modules/hal_nordic/nrfx/nrfx_glue.h index da0a445e7cb..2d4c25f4383 100644 --- a/modules/hal_nordic/nrfx/nrfx_glue.h +++ b/modules/hal_nordic/nrfx/nrfx_glue.h @@ -317,14 +317,12 @@ void nrfx_busy_wait(uint32_t usec_to_wait); /** @brief Bitmask that defines DPPI channels that are reserved for use outside of the nrfx library. */ #define NRFX_DPPI_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_NRFE) + NRFX_PPI_CHANNELS_USED_BY_MPSL) /** @brief Bitmask that defines DPPI groups that are reserved for use outside of the nrfx library. */ #define NRFX_DPPI_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_NRFE) + NRFX_PPI_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 | \ @@ -389,15 +387,6 @@ void nrfx_busy_wait(uint32_t usec_to_wait); #define NRFX_PPI_GROUPS_USED_BY_MPSL 0 #endif -#if defined(CONFIG_NRFE) -#include -#define NRFX_PPI_CHANNELS_USED_BY_NRFE NRFE_RESERVED_PPI_CHANNELS -#define NRFX_PPI_GROUPS_USED_BY_NRFE 0 -#else -#define NRFX_PPI_CHANNELS_USED_BY_NRFE 0 -#define NRFX_PPI_GROUPS_USED_BY_NRFE 0 -#endif - #if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) BUILD_ASSERT( (NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, From a79f0b6d64a75753dd22ad65d763caa49da07e50 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 054/825] Revert "[nrf noup] mgmt: mcumgr: grp: img_mgmt: Add handling for QSPI XIP" This reverts commit 6debbaf8115c13f31fca0d6acdadfad153e413b4. --- subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig | 8 -------- subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c | 6 ------ 2 files changed, 14 deletions(-) diff --git a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig index 20582a230d7..80e524ff72b 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig @@ -185,14 +185,6 @@ config MCUMGR_GRP_IMG_TOO_LARGE_BOOTLOADER_INFO endchoice -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 c11851eacf5..305cad41c44 100644 --- a/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c @@ -159,12 +159,6 @@ int img_mgmt_active_slot(int image) /* Multi image does not support DirectXIP currently */ #if CONFIG_MCUMGR_GRP_IMG_UPDATABLE_IMAGE_NUMBER > 1 slot = (image << 1); - -#if CONFIG_MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE - if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(slot1_partition)) { - slot += 1; - } -#endif #else /* This covers single image, including DirectXiP */ if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(slot1_partition)) { From a6e9deb871b6bf93397c38b9046a81951c11db2b Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 055/825] Revert "[nrf fromtree] doc: services: logging: Add section for Coresight STM logging" This reverts commit e734c8433f00bef70f08c682313e19792dc07ad8. --- doc/services/logging/cs_stm.rst | 241 ------------------ .../logging/images/coresight_architecture.png | Bin 76385 -> 0 bytes doc/services/logging/index.rst | 18 -- 3 files changed, 259 deletions(-) delete mode 100644 doc/services/logging/cs_stm.rst delete mode 100644 doc/services/logging/images/coresight_architecture.png diff --git a/doc/services/logging/cs_stm.rst b/doc/services/logging/cs_stm.rst deleted file mode 100644 index bf41ec3b25c..00000000000 --- a/doc/services/logging/cs_stm.rst +++ /dev/null @@ -1,241 +0,0 @@ -.. _logging_cs_stm: - -Multi-domain logging using ARM Coresight STM -############################################ - -The Arm CoreSight SoC-400 is a comprehensive library of components for the creation of debug and -trace functionality within a system. The STM (System Trace Macrocell) is a trace source that -is integrated into a CoreSight system, designed primarily for high-bandwidth trace of -instrumentation embedded into software. This instrumentation is made up of memory-mapped writes to -the STMESP (STM Extended Stimulus Port) peripheral registers. Multiple cores can share and directly -access the STM without being aware of each other. Each core has 65536 stimulus ports (identical -register sets) which can be independently accessed thus there is no need for locking when various -contexts want to log the data. - -STM Extended Stimulus Port (STMESP) -*********************************** - -Local domain (each core) has access to its own set of STMESP peripherals. Each set has registers for writing data (with or without timestamp and with or without marking) and writing a flag. Each write -to STMESP register results in the user data being encoded into MIPI System Trace Protocol v2 (STPv2). -Hardware manages multiplexing of data from different STMESP register sets and from different cores -by adding Major and Channel opcodes into the stream when necessary. Timestamp (from common source for all cores) and synchronization opcodes are autonomously added by the STM. - -Data stream generated by STM can end up in various sinks. For example it can be directly send to -TPIU (Trace Port Interface Unit) or saved in the RAM Circular Buffer which is called ETR (Embedded -Trace Router). TPIU is a 5 pin interface (4 data pins and clock) and external tool is required to -capture the data (e.g. J-Trace PRO). -When ETR is used then one core in the system is responsible for processing that data, for example -dumping it over UART to the host. - -ARM Coresight Embedded Trace Router (ETR) -***************************************** - -ETR is a circular RAM buffer to which tracing data is saved. Since it may contain data from -various sources additional wrapping protocol is used to multiplex them. ``Coresight Trace -Formatter`` is used for that. Data is encoded into 16 bytes frames which holds up to 15 byte -of data. Circular RAM buffer size is limited to 4k thus there is a risk of data overflow. If -overflow occurs then data is lost but due to presence of synchronization opcodes in the STPv2 -data stream synchronization can be restored. - -Data from ETR is handled on the device. It can be forwarded as-is to the host (e.g. using UART), -where a host tool is decoding the data or data can be decoded on-chip to output the data in human readable format. - -Nordic Semiconductor NRF54H20 implementation instead of using ETR peripheral for getting -buffer busyness is using own wrapper: Trace Buffer Monitor (TBM). - -STMESP Logging frontend -*********************** - -:ref:`log_frontend` API is implemented. Custom frontend assumes that all required operations are executed in the context of the logging macro call. It is also assumed that frontend provides the timestamp. Frontend utilizes a fact that there are multiple STMESP register sets and use multiple sets to avoid locking context. The atomically incremented channel counter is used to pick unique STMESP set and -whole message is written to that STMESP. Limited pool of sets is used leaving most of channels for -other purposes. - -Early logging -============= - -STMESP cannot be used before STM or ETR/TPIU is setup. In order to support early logging, -before infrastructure is ready a dedicated RAM buffer is used to which data is written. When -STM infrastructure readiness is notified (:c:func:`log_frontend_stmesp_etr_ready`) then RAM buffer -content is written to STMESP. Early logging is applicable only to the core which owns and configures -Coresight infrastructure (e.g. in case of NRF54H20 it is the Secure core). - -Trace points -============ - -There may be cases when logging is too slow (even though it is very fast). For cases like that a dedicated ``trace point`` API is added. It is extremely fast because it is just a single -write to one STMESP register. There are 2 functions in the API: - -* :c:func:`log_frontend_stmesp_tp` - It accepts single argument - index. Index is between - 0 and 65280. -* :c:func:`log_frontend_stmesp_tp_d32` - It accepts two arguments - index and user data. - Index is between 0 and 65280. User data is 32 bit word. - -It takes less than 100 ns to log a single trace point on NRF54H20 and it is approx. 7 times faster than the fastest log message. - -Logging using STM -***************** - -STM logging has 2 modes of operations: - -* Dictionary-based - assisted mode which is using dictionary-based logging. In this mode logging - strings can be removed from the binary because they are only needed for decoding and decoding - is performed by the host tool. This mode takes less memory and is faster (2-3 times faster). - There is less data written so there is less chance of data overflow in ETR buffer. -* Standalone - data is decoded on chip and human-readable strings are printed. This mode requires - more device resources and processing power. - -Following figure presents multi-domain logging using ARM Coresight STM. - -.. figure:: images/coresight_architecture.png - -Each core (local domain) is using logging frontend which writes logging data to STMESP registers. - -If TPIU is used as the output then there is no more software components needed. STPv2 stream -of data is composed by STM and send over TPIU. - -If ETR RAM buffer is used then buffer owner core (``proxy``) is responsible for handling that data. -If dictionary-based logging is used then proxy just sends data as-is over UART. -If standalone logging is used then proxy is using :ref:`cs_trace_defmt` and -:ref:`mipi_stp_decoder` to decode data and demultiplex messages. Messages are formatted to human -readable strings using logging :ref:`log_output`. - -Dictionary-based logging -======================== - -Assisted multicore logging uses dictionary-based logging to send messages without redundant strings -to STM, and is based on the :ref:`logging_guide_dictionary` feature of the logging API provided by -Zephyr. -Instead of including the format strings in the log messages, it logs the addresses (message IDs) -where the strings are stored, which reduces the size of the logging subsystem. -If the data goes to the ETR buffer, the proxy core's responsibility is to dump this data. -The host PC, equipped with a decoder tool, translates these addresses back into human-readable text -using a JSON database generated during the build process. - -When using logs, this method has the following advantages: - -* It reduces the size of the binary, as the strings used in the log messages are not stored in the binary itself. Logging infrastructure is also very limited. On local domains it is just the frontend. There is even no need to have string formatting function. -* It reduces the amount of data that needs to be sent to and processed by the application core, as the string formatting is offloaded to the host side. -* Logging is fast. It takes less than 1 us to log a simple message (up to 2 arguments) on NRF54H20. - -Proxy core is using Nordic specific peripheral (TBM) to get ETR buffer busyness and send data over -UART. Nordic specific driver for ETR buffer is located in -:zephyr_file:`drivers/misc/coresight/nrf_etr.c`. - -Configuration -------------- - -For Nordic SoC a dedicated snippet (:ref:`nordic-log-stm-dict`) shall be used to enable logging. -Each core shall be build with that snippet. If any core wants to use it then application core is -required to have it enabled too since it acts as the proxy (ETR buffer processing). All cores must use the same configuration of the logging. - -Reading the logs ----------------- - -To read the dictionary-based STM log output, do the following: - -1. Set up the log capture. - - Use the ``nrfutil trace stm`` command to start capturing logs from the device, specifying the database configuration for each domain ID, as well as the serial port, the baud rate, and the output file name:: - - nrfutil trace stm --database-config 34:build/zephyr/log_dictionary.json,35:build_rad/zephyr/log_dictionary.json --input-serialport /dev/ttyACM1 --baudrate 115200 --output-ascii out.txt - -#. Capture and decode the logs. - - nrfutil will capture the log data from the specified UART port and use the provided dictionary databases to decode the logs into a human-readable format. - The decoded logs will be saved in the specified output file (the :file:`out.txt` file in the previous example). - -#. Open the output file to review the decoded log messages. - - The file will contain timestamps and the log messages in a format that is human-readable. - -If the log capture fails to find a sync, rerun the capture process. - -.. note:: - Decoding artifacts or incorrect timestamps might occur when rerunning the process. - -Each log line contains a domain-related or core-related prefix between the log level and the module name, indicating the core that generated the log entry. -The following are the prefixes used to indicate the cores: - -.. csv-table:: nRF54H20 log prefixes - :header: "Core", "Prefix", "ID" - - Secure Domain, ``sec``, 0x21 - Application core, ``app``, 0x22 - Radio core, ``rad``, 0x23 - System Controller (SysCtrl), ``sys``, 0x2c - Fast Lightweight Processor (FLPR), ``flpr``, 0x2d - Peripheral Processor (PPR), ``ppr``, 0x2e - , ``mod``, 0x24 - -Stand-alone logging -=================== - -Frontend is writing to STMESP registers. Message format is aligned with the on chip decoder -in :zephyr_file:`subsys/logging/frontend/log_frontend_stmesp_demux.c`. - -``Proxy`` is using Nordic specific peripheral (TBM) to get ETR buffer busyness and read and -decode data and send human-readable data over UART. Nordic specific driver for ETR buffer is -located in :zephyr_file:`drivers/misc/coresight/nrf_etr.c`. It is using :ref:`cs_trace_defmt` and -:ref:`mipi_stp_decoder` and above-mentioned demultiplexer to decode messages. - -Logging messages contains read-only format string used in the logging macros thus they cannot be -removed from the binary. This mode uses more read-only memory and has lower throughput because -messages are longer and processing is time consuming. Compared to the dictionary-based mode logging -is 2-3 slower. - -Configuration -------------- - -For Nordic SoC a dedicated snippet (:ref:`nordic-log-stm`) shall be used to enable logging. -Each core shall be build with that snippet. If any core wants to use it then application core is -required to have it enabled too since it acts as the proxy (ETR buffer processing). All cores must use the same configuration of the logging. - -Reading the logs ----------------- - -Logs are printed using Console UART. - -.. note:: - To use UART in your application, the UART's node must be described in devicetree. - For more details, see :ref:`devicetree-intro`. - -The following is an example log output:: - - [00:00:00.154,790] app/spsc_pbuf: alloc in 0x2f0df800 - [00:00:00.163,319] app/spsc_pbuf: alloc 0x2f0df800 wr_idx:20 - [00:00:00.181,112] app/spsc_pbuf: commit in 0x2f0df800 - [00:00:00.189,090] app/spsc_pbuf: commit 0x2f0df800, len:20 wr_idx: 44 - [00:00:00.202,577] rad/icmsg: mbox_callback - [00:00:00.214,750] rad/spsc_pbuf: claim 0x2f0df800 rd_idx:20 - [00:00:00.235,823] rad/spsc_pbuf: free 0x2f0df800 len:20 rd_idx: 44 - [00:00:00.244,507] rad/spsc_pbuf: read done 0x2f0df800 len:20 - [00:00:00.272,444] rad/host: ep recv 0x330021f0, len:20 - [00:00:00.283,939] rad/host: rx:00 exp:00 - [00:00:00.292,200] rad/icmsg: read 0 - [00:00:05.077,026] rad/spsc_pbuf: alloc in 0x2f0df000 - [00:00:05.077,068] rad/spsc_pbuf: alloc 0x2f0df000 wr_idx:44 - [00:00:05.077,098] rad/spsc_pbuf: commit in 0x2f0df000 - [00:00:05.077,134] rad/spsc_pbuf: commit 0x2f0df000, len:20 wr_idx - -Each log line contains a domain-related or core-related prefix between the log level and the module name, indicating the core that generated the log entry. -The following are the prefixes used to indicate the cores: - -.. csv-table:: nRF54H20 log prefixes - :header: "Core", "Prefix" - - Secure Domain, ``sec`` - Application core, ``app`` - Radio core, ``rad`` - System Controller (SysCtrl), ``sys`` - Fast Lightweight Processor (FLPR), ``flpr`` - Peripheral Processor (PPR), ``ppr`` - -Additional considerations -========================= - -When using STM logging, consider the following: - -* Use optimized log macros (having up to 2 word size numeric arguments, like ``LOG_INF("%d %c", (int)x, (char)y)``) to improve the size and speed of logging. -* For memory constrained applications (for example, when running on the PPR core), disable the ``printk()`` function by setting both the :kconfig:option:`CONFIG_PRINTK` and :kconfig:option:`CONFIG_BOOT_BANNER` Kconfig options to ``n`` in your project configuration. -* When working with multiple domains, such as the Radio core and Application core, ensure that each database is prefixed with the correct domain ID. -* Some log messages might be dropped due to the limited size of the RAM buffer that stores STM logs. diff --git a/doc/services/logging/images/coresight_architecture.png b/doc/services/logging/images/coresight_architecture.png deleted file mode 100644 index ac351661ea08f1a26a6601f0e42dd75c3a0b0125..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 76385 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%0ApLm+^QVry8Vt=3;g-3 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 Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 056/825] Revert "[nrf fromtree] samples: boards: nrf: nrf_coresight_stm: Add new configurations" This reverts commit c1d02198c09db9ce7ffacdbd5e2e0f94f9f18c7b. --- samples/boards/nrf/coresight_stm/prj.conf | 2 +- .../boards/nrf/coresight_stm/remote/prj.conf | 2 +- samples/boards/nrf/coresight_stm/sample.yaml | 32 ------------------- samples/boards/nrf/coresight_stm/src/main.c | 30 +++++++---------- 4 files changed, 14 insertions(+), 52 deletions(-) diff --git a/samples/boards/nrf/coresight_stm/prj.conf b/samples/boards/nrf/coresight_stm/prj.conf index 1e935e973c7..1bb8bf6d7fd 100644 --- a/samples/boards/nrf/coresight_stm/prj.conf +++ b/samples/boards/nrf/coresight_stm/prj.conf @@ -1 +1 @@ -CONFIG_LOG=y +# empty diff --git a/samples/boards/nrf/coresight_stm/remote/prj.conf b/samples/boards/nrf/coresight_stm/remote/prj.conf index 1e935e973c7..1bb8bf6d7fd 100644 --- a/samples/boards/nrf/coresight_stm/remote/prj.conf +++ b/samples/boards/nrf/coresight_stm/remote/prj.conf @@ -1 +1 @@ -CONFIG_LOG=y +# empty diff --git a/samples/boards/nrf/coresight_stm/sample.yaml b/samples/boards/nrf/coresight_stm/sample.yaml index 2bf3f0695e8..07e17766279 100644 --- a/samples/boards/nrf/coresight_stm/sample.yaml +++ b/samples/boards/nrf/coresight_stm/sample.yaml @@ -11,35 +11,3 @@ tests: build_only: true required_snippets: - nordic-log-stm-dict - sample.boards.nrf.coresight_stm: - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp - harness: console - harness_config: - type: multi_line - ordered: true - regex: - - "Timing for log message with 0 arguments:" - - "Timing for log message with 1 argument:" - - "Timing for log message with 2 arguments:" - - "Timing for log message with 3 arguments:" - - "Timing for log_message with string:" - required_snippets: - - nordic-log-stm - sample.boards.nrf.coresight_stm.local_uart: - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp - harness: console - harness_config: - type: multi_line - ordered: true - regex: - - "Timing for log message with 0 arguments:" - - "Timing for log message with 1 argument:" - - "Timing for log message with 2 arguments:" - - "Timing for log message with 3 arguments:" - - "Timing for log_message with string:" diff --git a/samples/boards/nrf/coresight_stm/src/main.c b/samples/boards/nrf/coresight_stm/src/main.c index c5bf328678b..c203910b127 100644 --- a/samples/boards/nrf/coresight_stm/src/main.c +++ b/samples/boards/nrf/coresight_stm/src/main.c @@ -7,11 +7,7 @@ #include #include #include - -#ifdef CONFIG_LOG_FRONTEND_STMESP #include -#endif - LOG_MODULE_REGISTER(app); #define TEST_LOG(rpt, item) \ @@ -55,7 +51,8 @@ int main(void) uint32_t t; uint32_t delta; uint32_t rpt = 10; - uint32_t t0, t1, t2, t3, t_s; + uint32_t rpt_tp = 20; + uint32_t t0, t1, t2, t3, t_s, t_tp, t_tpd; char str[] = "test string"; get_core_name(); @@ -78,16 +75,13 @@ int main(void) t_s = TEST_LOG(rpt, (LOG_INF("test with string %s", str))); t_s -= delta; -#ifdef CONFIG_LOG_FRONTEND_STMESP - uint32_t rpt_tp = 20; - uint32_t t_tp, t_tpd; + if (IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP)) { + t_tp = TEST_LOG(rpt_tp, (log_frontend_stmesp_tp(5))); + t_tp -= delta; - t_tp = TEST_LOG(rpt_tp, (log_frontend_stmesp_tp(5))); - t_tp -= delta; - - t_tpd = TEST_LOG(rpt_tp, (log_frontend_stmesp_tp_d32(6, 10))); - t_tpd -= delta; -#endif + t_tpd = TEST_LOG(rpt_tp, (log_frontend_stmesp_tp_d32(6, 10))); + t_tpd -= delta; + } timing_report(t0, rpt, "log message with 0 arguments"); timing_report(t1, rpt, "log message with 1 argument"); @@ -95,10 +89,10 @@ int main(void) timing_report(t3, rpt, "log message with 3 arguments"); timing_report(t_s, rpt, "log_message with string"); -#ifdef CONFIG_LOG_FRONTEND_STMESP - timing_report(t_tp, rpt_tp, "tracepoint"); - timing_report(t_tpd, rpt_tp, "tracepoint_d32"); -#endif + if (IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP)) { + timing_report(t_tp, rpt_tp, "tracepoint"); + timing_report(t_tpd, rpt_tp, "tracepoint_d32"); + } return 0; } From b6804031d6dba3375a6549f27bc93b4dda0375af Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 057/825] Revert "[nrf fromtree] snippets: Add nordic-log-stm for logging using STMESP" This reverts commit aa9525344b937c9336b9a9e52209cc35fbb2cfd7. --- snippets/nordic-log-stm/README.rst | 11 ----------- .../nordic-log-stm/boards/nrf54h20_cpuapp.conf | 1 - .../nordic-log-stm/boards/nrf54h20_cpuapp.overlay | 14 -------------- snippets/nordic-log-stm/log_stm.conf | 6 ------ snippets/nordic-log-stm/snippet.yml | 8 -------- 5 files changed, 40 deletions(-) delete mode 100644 snippets/nordic-log-stm/README.rst delete mode 100644 snippets/nordic-log-stm/boards/nrf54h20_cpuapp.conf delete mode 100644 snippets/nordic-log-stm/boards/nrf54h20_cpuapp.overlay delete mode 100644 snippets/nordic-log-stm/log_stm.conf delete mode 100644 snippets/nordic-log-stm/snippet.yml diff --git a/snippets/nordic-log-stm/README.rst b/snippets/nordic-log-stm/README.rst deleted file mode 100644 index 9af46467b8b..00000000000 --- a/snippets/nordic-log-stm/README.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. _nordic-log-stm: - -Nordic Standalone STM logging snippet (nordic-log-stm) -###################################################### - -Overview -******** - -This snippet allows users to build Zephyr with the logging to the Coresight STM -stimulus ports. Data is collected in ETR buffer. Data from ETR buffer is -decoded and human-readable data is output on the UART. diff --git a/snippets/nordic-log-stm/boards/nrf54h20_cpuapp.conf b/snippets/nordic-log-stm/boards/nrf54h20_cpuapp.conf deleted file mode 100644 index b4d9d63f77c..00000000000 --- a/snippets/nordic-log-stm/boards/nrf54h20_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_UART_ASYNC_API=y diff --git a/snippets/nordic-log-stm/boards/nrf54h20_cpuapp.overlay b/snippets/nordic-log-stm/boards/nrf54h20_cpuapp.overlay deleted file mode 100644 index bedc93411c9..00000000000 --- a/snippets/nordic-log-stm/boards/nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor - * SPDX-License-Identifier: Apache-2.0 - */ - -&tbm { - status = "okay"; -}; - -&tddconf { - status = "okay"; - stmsink = "etr"; - portconfig = <0>; -}; diff --git a/snippets/nordic-log-stm/log_stm.conf b/snippets/nordic-log-stm/log_stm.conf deleted file mode 100644 index 1325c25b505..00000000000 --- a/snippets/nordic-log-stm/log_stm.conf +++ /dev/null @@ -1,6 +0,0 @@ -CONFIG_LOG=y -CONFIG_TEST_LOGGING_DEFAULTS=n -CONFIG_LOG_FRONTEND=y -CONFIG_LOG_FRONTEND_ONLY=y -CONFIG_LOG_FRONTEND_STMESP=y -CONFIG_LOG_FRONTEND_STMESP_FSC=y diff --git a/snippets/nordic-log-stm/snippet.yml b/snippets/nordic-log-stm/snippet.yml deleted file mode 100644 index 1cd65087bcc..00000000000 --- a/snippets/nordic-log-stm/snippet.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: nordic-log-stm -append: - EXTRA_CONF_FILE: log_stm.conf -boards: - /.*/nrf54h20/cpuapp/: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpuapp.overlay - EXTRA_CONF_FILE: boards/nrf54h20_cpuapp.conf From 2e815a15055b4631bbdf54b953b1500a821e4bf1 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 058/825] Revert "[nrf fromtree] logging: log_frontend_stmesp: Add support for standalone mode" This reverts commit 57f79c394c20e1a38997d7fbbdb288d71c8fe1e3. --- subsys/logging/frontends/Kconfig | 6 +- .../logging/frontends/log_frontend_stmesp.c | 91 +------------------ 2 files changed, 4 insertions(+), 93 deletions(-) diff --git a/subsys/logging/frontends/Kconfig b/subsys/logging/frontends/Kconfig index e984532d6f2..c75ec51e52c 100644 --- a/subsys/logging/frontends/Kconfig +++ b/subsys/logging/frontends/Kconfig @@ -38,16 +38,12 @@ if LOG_FRONTEND_STMESP config LOG_FRONTEND_STMESP_DICT bool - default y if !LOG_FRONTEND_STMESP_FSC + default y select LOG_FRONTEND_OPT_API select LOG_DICTIONARY_DB imply LOG_FMT_SECTION imply LOG_FMT_SECTION_STRIP -config LOG_FRONTEND_STMESP_FSC - bool "Send fully self-contained messages" - select LOG_MSG_APPEND_RO_STRING_LOC if !NRF_ETR - config LOG_FRONTEND_STMESP_FLUSH_COUNT int "Number of flushing words" default 4 diff --git a/subsys/logging/frontends/log_frontend_stmesp.c b/subsys/logging/frontends/log_frontend_stmesp.c index 389f0f72aeb..d50e1c8320d 100644 --- a/subsys/logging/frontends/log_frontend_stmesp.c +++ b/subsys/logging/frontends/log_frontend_stmesp.c @@ -6,14 +6,10 @@ #include #include #include -#include #include #include #include #include -#ifdef CONFIG_NRF_ETR -#include -#endif /* Only 32 bit platforms supported. */ BUILD_ASSERT(sizeof(void *) == sizeof(uint32_t)); @@ -190,21 +186,16 @@ static inline uint32_t early_buf_get_data(void **buf) return 0; } -static void early_buf_put_data(const void *buf, size_t len) +static int early_package_cb(const void *buf, size_t len, void *ctx) { + ARG_UNUSED(ctx); + if (early_buf_has_space(len)) { memcpy(&early_buf[early_buf_idx], buf, len); early_buf_idx += len; } else { early_buf_idx = EARLY_BUF_SIZE; } -} - -static int early_package_cb(const void *buf, size_t len, void *ctx) -{ - ARG_UNUSED(ctx); - - early_buf_put_data(buf, len); return 0; } @@ -269,77 +260,6 @@ static inline void early_msg_end(uint32_t *len_loc) } } -#if CONFIG_LOG_FRONTEND_STMESP_FSC -void log_frontend_msg(const void *source, const struct log_msg_desc desc, uint8_t *package, - const void *data) -{ - uint16_t strl[4]; - union log_frontend_stmesp_demux_header hdr = {.log = {.level = desc.level}}; - bool use_timestamp = desc.level != LOG_LEVEL_INTERNAL_RAW_STRING; - const char *sname; - static const char null_c = '\0'; - size_t sname_len; - int package_len; - int total_len; - static const uint32_t flags = CBPRINTF_PACKAGE_CONVERT_RW_STR | - CBPRINTF_PACKAGE_CONVERT_RO_STR; - - sname = log_source_name_get(0, get_source_id(source)); - if (sname) { - sname_len = strlen(sname) + 1; - } else { - sname = &null_c; - sname_len = 1; - } - total_len = desc.data_len + sname_len /* null terminator */; - - package_len = cbprintf_package_convert(package, desc.package_len, NULL, NULL, flags, - strl, ARRAY_SIZE(strl)); - hdr.log.total_len = total_len + package_len; - hdr.log.package_len = package_len; - - if ((EARLY_BUF_SIZE == 0) || etr_rdy) { - STMESP_Type *stm_esp; - int err; - - err = stmesp_get_port(get_channel(), &stm_esp); - if (err < 0) { - return; - } - - STM_D32(stm_esp, hdr.raw, use_timestamp, true); - (void)cbprintf_package_convert(package, desc.package_len, - package_cb, stm_esp, flags, strl, ARRAY_SIZE(strl)); - write_data(sname, sname_len, stm_esp); - if (data) { - write_data(data, desc.data_len, stm_esp); - } - packet_end(stm_esp); - - } else { - k_spinlock_key_t key = k_spin_lock(&lock); - - if ((EARLY_BUF_SIZE == 0) || - (early_buf_alloc(hdr.log.total_len + sizeof(hdr)) == false)) { - dropped++; - k_spin_unlock(&lock, key); - return; - } - - early_buf_put_data((const uint8_t *)&hdr, sizeof(hdr)); - (void)cbprintf_package_convert(package, desc.package_len, early_package_cb, - NULL, flags, strl, ARRAY_SIZE(strl)); - early_buf_put_data(sname, sname_len); - if (data) { - early_buf_put_data(data, desc.data_len); - } - - k_spin_unlock(&lock, key); - } -} - -#else /* CONFIG_LOG_FRONTEND_STMESP_FSC */ - void log_frontend_msg(const void *source, const struct log_msg_desc desc, uint8_t *package, const void *data) { @@ -497,14 +417,9 @@ void log_frontend_simple_2(const void *source, uint32_t level, const char *fmt, k_spin_unlock(&lock, key); } -#endif /* CONFIG_LOG_FRONTEND_STMESP_FSC */ - void log_frontend_panic(void) { in_panic = true; -#ifdef CONFIG_NRF_ETR - nrf_etr_flush(); -#endif } void log_frontend_init(void) From bffe73be8eaf3fed2427cffd9768606f22baf4e3 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 059/825] Revert "[nrf fromtree] drivers: misc: coresight: nrf_etr: Add standalone mode" This reverts commit aeff44fa2322c917dd1ef79e268207110b2f5756. --- drivers/misc/CMakeLists.txt | 1 - drivers/misc/coresight/Kconfig | 30 - drivers/misc/coresight/nrf_etr.c | 537 ++---------------- .../zephyr/drivers/misc/coresight/nrf_etr.h | 20 - 4 files changed, 38 insertions(+), 550 deletions(-) delete mode 100644 include/zephyr/drivers/misc/coresight/nrf_etr.h diff --git a/drivers/misc/CMakeLists.txt b/drivers/misc/CMakeLists.txt index f1453a8c284..1c0da74d998 100644 --- a/drivers/misc/CMakeLists.txt +++ b/drivers/misc/CMakeLists.txt @@ -9,4 +9,3 @@ add_subdirectory_ifdef(CONFIG_TIMEAWARE_GPIO timeaware_gpio) add_subdirectory_ifdef(CONFIG_DEVMUX devmux) add_subdirectory_ifdef(CONFIG_NORDIC_VPR_LAUNCHER nordic_vpr_launcher) add_subdirectory_ifdef(CONFIG_MCUX_FLEXIO mcux_flexio) -add_subdirectory(coresight) diff --git a/drivers/misc/coresight/Kconfig b/drivers/misc/coresight/Kconfig index f32abe80dab..0e670845de7 100644 --- a/drivers/misc/coresight/Kconfig +++ b/drivers/misc/coresight/Kconfig @@ -15,36 +15,8 @@ config NRF_ETR if NRF_ETR -config NRF_ETR_DECODE - bool "Decode ETR content" - default y if LOG_FRONTEND_STMESP_FSC - select MIPI_STP_DECODER - select CS_TRACE_DEFMT - select LOG_FRONTEND_STMESP_DEMUX - select LOG_OUTPUT - imply CBPRINTF_FP_SUPPORT - help - In this mode, log messages stored by Coresight STM logging frontends are - decoded and printed in the human readable form. - -config NRF_ETR_DECODE_DROP_PERIOD - int "Period of dropped messages notification" - default 5000 - help - Period (in milliseconds) how often it is checked if any dropped messages - have occurred. - -config NRF_ETR_DEBUG - bool "Debug mode" - depends on !LOG_PRINTK - select MIPI_STP_DECODER - select CS_TRACE_DEFMT - help - In debug mode STPv2 decoded data is printed. - config NRF_ETR_STACK_SIZE int "ETR thread stack size" - default 2048 if NRF_ETR_DECODE || NRF_ETR_DEBUG default 1024 config NRF_ETR_BACKOFF @@ -63,8 +35,6 @@ config NRF_ETR_FLUSH_TIMEOUT config NRF_ETR_SYNC_PERIOD int "Period of custom synchronization frame" - default 0 if NRF_ETR_DECODE - default 0 if NRF_ETR_DEBUG default 16 help To help find the synchronization when decoding the ETR content diff --git a/drivers/misc/coresight/nrf_etr.c b/drivers/misc/coresight/nrf_etr.c index dd1c13af4f7..fbd0ea08936 100644 --- a/drivers/misc/coresight/nrf_etr.c +++ b/drivers/misc/coresight/nrf_etr.c @@ -9,14 +9,8 @@ #include #include #include -#include #include -#include -#include -#include #include -#include -#include #include #include LOG_MODULE_REGISTER(cs_etr_tbm); @@ -25,11 +19,10 @@ LOG_MODULE_REGISTER(cs_etr_tbm); #define ETR_BUFFER_NODE DT_NODELABEL(etr_buffer) -#define DROP_CHECK_PERIOD \ - COND_CODE_1(CONFIG_NRF_ETR_DECODE, \ - (CONFIG_NRF_ETR_DECODE_DROP_PERIOD), (0)) +#define CORESIGHT_TRACE_FRAME_SIZE32 4 +#define FRAME_SIZE8 (CORESIGHT_TRACE_FRAME_SIZE32 * sizeof(uint32_t)) -#define MIN_DATA (2 * CORESIGHT_TRACE_FRAME_SIZE32) +#define MIN_DATA CORESIGHT_TRACE_FRAME_SIZE32 #define MEMORY_SECTION(node) \ COND_CODE_1(DT_NODE_HAS_PROP(node, memory_regions), \ @@ -37,60 +30,19 @@ LOG_MODULE_REGISTER(cs_etr_tbm); LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(node, memory_regions)))))), \ ()) -/* Since ETR debug is a part of logging infrastructure, logging cannot be used - * for debugging. Printk is used (assuming CONFIG_LOG_PRINTK=n) - */ -#define DBG(...) IF_ENABLED(CONFIG_NRF_ETR_DEBUG, (printk(__VA_ARGS__))) - -/** @brief Macro for dumping debug data. - * - * @param _data Data variable. - * @param _nlen Number of nibbles in @p _data to print. - */ -#define DBG_DATA(_data, _nlen, _marked) \ - do { \ - char *fmt; \ - switch (_nlen) { \ - case 2: \ - fmt = "D%s\t%02x "; \ - break; \ - case 4: \ - fmt = "D%s\t%04x "; \ - break; \ - case 8: \ - fmt = "D%s\t%08x "; \ - break; \ - default: \ - fmt = "D%s\t%016x "; \ - break; \ - } \ - DBG(fmt, _marked ? "M" : "", _data); \ - for (int i = 0; i < _nlen / 2; i++) { \ - DBG("%c ", ((char *)&_data)[i]); \ - } \ - DBG("\n"); \ - } while (0) - static const uint32_t wsize_mask = DT_REG_SIZE(ETR_BUFFER_NODE) / sizeof(int) - 1; static const uint32_t wsize_inc = DT_REG_SIZE(ETR_BUFFER_NODE) / sizeof(int) - 1; -static bool in_sync; -static int oosync_cnt; static volatile bool tbm_full; static volatile uint32_t base_wr_idx; static uint32_t etr_rd_idx; -/* Counts number of new messages completed in the current formatter frame decoding. */ -static uint32_t new_msg_cnt; - static bool volatile use_async_uart; static struct k_sem uart_sem; static const struct device *uart_dev = DEVICE_DT_GET(UART_NODE); static uint32_t frame_buf0[CORESIGHT_TRACE_FRAME_SIZE32] MEMORY_SECTION(UART_NODE); static uint32_t frame_buf1[CORESIGHT_TRACE_FRAME_SIZE32] MEMORY_SECTION(UART_NODE); -static uint32_t frame_buf_decode[CORESIGHT_TRACE_FRAME_SIZE32]; -static uint32_t *frame_buf = IS_ENABLED(CONFIG_NRF_ETR_DECODE) ? - frame_buf_decode : frame_buf0; +static uint32_t *frame_buf = frame_buf0; K_KERNEL_STACK_DEFINE(etr_stack, CONFIG_NRF_ETR_STACK_SIZE); static struct k_thread etr_thread; @@ -98,317 +50,6 @@ static struct k_thread etr_thread; BUILD_ASSERT((DT_REG_SIZE(ETR_BUFFER_NODE) % CONFIG_DCACHE_LINE_SIZE) == 0); BUILD_ASSERT((DT_REG_ADDR(ETR_BUFFER_NODE) % CONFIG_DCACHE_LINE_SIZE) == 0); -/* Domain details and prefixes. */ -static const uint16_t stm_m_id[] = {0x21, 0x22, 0x23, 0x2c, 0x2d, 0x2e, 0x24, 0x80}; -static const char *const stm_m_name[] = {"sec", "app", "rad", "sys", "flpr", "ppr", "mod", "hw"}; -static const char *const hw_evts[] = { - "CTI211_0", /* 0 CTI211 triger out 1 */ - "CTI211_1", /* 1 CTI211 triger out 1 inverted */ - "CTI211_2", /* 2 CTI211 triger out 2 */ - "CTI211_3", /* 3 CTI211 triger out 2 inverted*/ - "Sec up", /* 4 Secure Domain up */ - "Sec down", /* 5 Secure Domain down */ - "App up", /* 6 Application Domain up */ - "App down", /* 7 Application Domain down */ - "Rad up", /* 8 Radio Domain up */ - "Rad down", /* 9 Radio Domain down */ - "Radf up", /* 10 Radio fast up */ - "Radf down", /* 11 Radio fast down */ - NULL, /* Reserved */ - NULL, /* Reserved */ - NULL, /* Reserved */ - NULL, /* Reserved */ - NULL, /* Reserved */ - NULL, /* Reserved */ - NULL, /* Reserved */ - NULL, /* Reserved */ - NULL, /* Reserved */ - NULL, /* Reserved */ - NULL, /* Reserved */ - NULL, /* Reserved */ - NULL, /* Reserved */ - NULL, /* Reserved */ - "GD LL up", /* 26 Global domain low leakage up */ - "GD LL down", /* 27 Global domain low leakage down */ - "GD1 HS up", /* 28 Global domain high speed 1 up */ - "GD1 HS up", /* 29 Global domain high speed 1 up */ - "GD0 HS down", /* 30 Global domain high speed 0 down */ - "GD0 HS down", /* 31 Global domain high speed 0 down */ -}; - -static int log_output_func(uint8_t *buf, size_t size, void *ctx) -{ - if (use_async_uart) { - int err; - static uint8_t *tx_buf = (uint8_t *)frame_buf0; - - err = k_sem_take(&uart_sem, K_FOREVER); - __ASSERT_NO_MSG(err >= 0); - - memcpy(tx_buf, buf, size); - - err = uart_tx(uart_dev, tx_buf, size, SYS_FOREVER_US); - __ASSERT_NO_MSG(err >= 0); - - tx_buf = (tx_buf == (uint8_t *)frame_buf0) ? - (uint8_t *)frame_buf1 : (uint8_t *)frame_buf0; - } else { - for (int i = 0; i < size; i++) { - uart_poll_out(uart_dev, buf[i]); - } - } - - return size; -} - -static uint8_t log_output_buf[CORESIGHT_TRACE_FRAME_SIZE]; -LOG_OUTPUT_DEFINE(log_output, log_output_func, log_output_buf, sizeof(log_output_buf)); - -/** @brief Process a log message. */ -static void log_message_process(struct log_frontend_stmesp_demux_log *packet) -{ - uint32_t flags = LOG_OUTPUT_FLAG_COLORS | LOG_OUTPUT_FLAG_LEVEL | - LOG_OUTPUT_FLAG_TIMESTAMP | LOG_OUTPUT_FLAG_FORMAT_TIMESTAMP; - uint64_t ts = packet->timestamp; - uint8_t level = packet->hdr.level; - uint16_t plen = packet->hdr.package_len; - const char *dname = stm_m_name[packet->hdr.major]; - const uint8_t *package = packet->data; - const char *sname = &packet->data[plen]; - size_t sname_len = strlen(sname) + 1; - uint16_t dlen = packet->hdr.total_len - (plen + sname_len); - uint8_t *data = dlen ? &packet->data[plen + sname_len] : NULL; - - log_output_process(&log_output, ts, dname, sname, NULL, level, package, data, dlen, flags); -} - -/** @brief Process a trace point message. */ -static void trace_point_process(struct log_frontend_stmesp_demux_trace_point *packet) -{ - static const uint32_t flags = LOG_OUTPUT_FLAG_TIMESTAMP | LOG_OUTPUT_FLAG_FORMAT_TIMESTAMP; - static const char *tp = "%d"; - static const char *tp_d32 = "%d %08x"; - const char *dname = stm_m_name[packet->major]; - static const char *sname = "tp"; - - if (packet->has_data) { - static const union cbprintf_package_hdr desc = { - .desc = {.len = 4 /* hdr + fmt + id + data */}}; - uint32_t tp_d32_p[] = {(uint32_t)desc.raw, (uint32_t)tp_d32, packet->id, - packet->data}; - - log_output_process(&log_output, packet->timestamp, dname, sname, NULL, 1, - (const uint8_t *)tp_d32_p, NULL, 0, flags); - return; - } - - static const union cbprintf_package_hdr desc = {.desc = {.len = 3 /* hdr + fmt + id */}}; - uint32_t tp_p[] = {(uint32_t)desc.raw, (uint32_t)tp, packet->id}; - - log_output_process(&log_output, packet->timestamp, dname, sname, NULL, - 1, (const uint8_t *)tp_p, NULL, 0, flags); -} - -/** @brief Process a HW event message. */ -static void hw_event_process(struct log_frontend_stmesp_demux_hw_event *packet) -{ - static const uint32_t flags = LOG_OUTPUT_FLAG_TIMESTAMP | LOG_OUTPUT_FLAG_FORMAT_TIMESTAMP; - static const char *tp = "%s"; - static const char *dname = "hw"; - static const char *sname = "event"; - const char *evt_name = packet->evt < ARRAY_SIZE(hw_evts) ? hw_evts[packet->evt] : "invalid"; - static const union cbprintf_package_hdr desc = {.desc = {.len = 3 /* hdr + fmt + id */}}; - uint32_t tp_p[] = {(uint32_t)desc.raw, (uint32_t)tp, (uint32_t)evt_name}; - - log_output_process(&log_output, packet->timestamp, dname, sname, NULL, - 1, (const uint8_t *)tp_p, NULL, 0, flags); -} - -static void message_process(union log_frontend_stmesp_demux_packet packet) -{ - switch (packet.generic_packet->type) { - case LOG_FRONTEND_STMESP_DEMUX_TYPE_TRACE_POINT: - trace_point_process(packet.trace_point); - break; - case LOG_FRONTEND_STMESP_DEMUX_TYPE_HW_EVENT: - hw_event_process(packet.hw_event); - break; - default: - log_message_process(packet.log); - break; - } -} - -/** @brief Function called when potential STPv2 stream data drop is detected. - * - * When that occurs all active messages in the demultiplexer are marked as invalid and - * stp_decoder is switching to re-synchronization mode where data is decoded in - * search for ASYNC opcode. - */ -static void sync_loss(void) -{ - if (IS_ENABLED(CONFIG_NRF_ETR_DECODE)) { - mipi_stp_decoder_sync_loss(); - log_frontend_stmesp_demux_reset(); - oosync_cnt++; - in_sync = false; - } -} - -/** @brief Indicate that STPv2 decoder is synchronized. - * - * That occurs when ASYNC opcode is found. - */ -static void on_resync(void) -{ - if (IS_ENABLED(CONFIG_NRF_ETR_DECODE)) { - in_sync = true; - } -} - -static void decoder_cb_debug(enum mipi_stp_decoder_ctrl_type type, - union mipi_stp_decoder_data data, - uint64_t *ts, bool marked) -{ - switch (type) { - case STP_DECODER_MAJOR: - DBG("M%04x\n", data.id); - break; - case STP_DECODER_CHANNEL: - DBG("C%04x\n", data.id); - break; - case STP_DATA8: - DBG_DATA(data.data, 2, marked); - if (ts) { - DBG("TS:%lld\n", *ts); - } - break; - case STP_DATA16: - DBG_DATA(data.data, 4, marked); - break; - case STP_DATA32: - DBG_DATA(data.data, 8, marked); - if (ts) { - DBG("TS:%lld\n", *ts); - } - break; - case STP_DATA64: - DBG_DATA(data.data, 16, marked); - break; - case STP_DECODER_FLAG: - DBG("F%s\n", ts ? "TS" : ""); - break; - case STP_DECODER_NULL: - DBG("NULL\n"); - break; - case STP_DECODER_MERROR: - DBG("MERR\n"); - break; - case STP_DECODER_VERSION: - DBG("VER\n"); - break; - case STP_DECODER_FREQ: { - DBG("FREQ%s %d\n", ts ? "TS" : "", (int)data.freq); - break; - } - case STP_DECODER_GERROR: - DBG("GERR\n"); - break; - case STP_DECODER_ASYNC: - DBG("ASYNC\n"); - break; - case STP_DECODER_NOT_SUPPORTED: - DBG("NOTSUP\n"); - break; - default: - DBG("OTHER\n"); - break; - } -} - -static void decoder_cb(enum mipi_stp_decoder_ctrl_type type, - union mipi_stp_decoder_data data, uint64_t *ts, - bool marked) -{ - int rv = 0; - - decoder_cb_debug(type, data, ts, marked); - - if (!IS_ENABLED(CONFIG_NRF_ETR_DECODE)) { - return; - } - - switch (type) { - case STP_DECODER_ASYNC: - on_resync(); - break; - case STP_DECODER_MAJOR: - log_frontend_stmesp_demux_major(data.id); - break; - case STP_DECODER_CHANNEL: - log_frontend_stmesp_demux_channel(data.id); - break; - case STP_DATA8: - if (marked) { - rv = log_frontend_stmesp_demux_packet_start((uint32_t *)&data.data, ts); - new_msg_cnt += rv; - } else { - log_frontend_stmesp_demux_data((char *)&data.data, 1); - } - break; - case STP_DATA16: - log_frontend_stmesp_demux_data((char *)&data.data, 2); - break; - case STP_DATA32: - if (marked) { - rv = log_frontend_stmesp_demux_packet_start((uint32_t *)&data.data, ts); - new_msg_cnt += rv; - } else { - log_frontend_stmesp_demux_data((char *)&data.data, 4); - if (ts) { - log_frontend_stmesp_demux_timestamp(*ts); - } - } - break; - case STP_DATA64: - log_frontend_stmesp_demux_data((char *)&data.data, 8); - break; - case STP_DECODER_FLAG: - if (ts) { - log_frontend_stmesp_demux_packet_start(NULL, ts); - } else { - log_frontend_stmesp_demux_packet_end(); - } - new_msg_cnt++; - break; - case STP_DECODER_FREQ: { - static uint32_t freq; - /* Avoid calling log_output function multiple times as frequency - * is sent periodically. - */ - if (freq != (uint32_t)data.freq) { - freq = (uint32_t)data.freq; - log_output_timestamp_freq_set(freq); - } - break; - } - case STP_DECODER_MERROR: { - sync_loss(); - break; - } - default: - break; - } - - /* Only -ENOMEM is accepted failure. */ - __ASSERT_NO_MSG((rv >= 0) || (rv == -ENOMEM)); -} - -static void deformatter_cb(uint32_t id, const uint8_t *data, size_t len) -{ - mipi_stp_decoder_decode(data, len); -} - /** @brief Get write index. * * It is a non-wrapping 32 bit write index. To get actual index in the ETR buffer @@ -446,60 +87,6 @@ static void rd_idx_inc(void) etr_rd_idx += CORESIGHT_TRACE_FRAME_SIZE32; } -/** @brief Process frame. */ -static void process_frame(uint8_t *buf, uint32_t pending) -{ - DBG("%d (wr:%d): ", pending, get_wr_idx() & wsize_mask); - for (int j = 0; j < CORESIGHT_TRACE_FRAME_SIZE; j++) { - DBG("%02x ", ((uint8_t *)buf)[j]); - } - DBG("\n"); - cs_trace_defmt_process((uint8_t *)buf, CORESIGHT_TRACE_FRAME_SIZE); - DBG("\n"); -} - -static void process_messages(void) -{ - static union log_frontend_stmesp_demux_packet curr_msg; - - /* Process any new messages. curr_msg remains the same if panic - * interrupts currently ongoing processing (curr_msg is not NULL then). - * In such a case it is processed once again, which may lead to - * a partial repetition of that message on the output. - */ - while (new_msg_cnt || curr_msg.generic_packet) { - if (!curr_msg.generic_packet) { - curr_msg = log_frontend_stmesp_demux_claim(); - } - if (curr_msg.generic_packet) { - message_process(curr_msg); - log_frontend_stmesp_demux_free(curr_msg); - curr_msg.generic_packet = NULL; - } else { - break; - } - } - new_msg_cnt = 0; -} - -/** @brief Dump frame over UART (using polling or async API). */ -static void dump_frame(uint8_t *buf) -{ - int err; - - if (use_async_uart) { - err = k_sem_take(&uart_sem, K_FOREVER); - __ASSERT_NO_MSG(err >= 0); - - err = uart_tx(uart_dev, buf, CORESIGHT_TRACE_FRAME_SIZE, SYS_FOREVER_US); - __ASSERT_NO_MSG(err >= 0); - } else { - for (int i = 0; i < CORESIGHT_TRACE_FRAME_SIZE; i++) { - uart_poll_out(uart_dev, buf[i]); - } - } -} - /** @brief Attempt to process data pending in the ETR circular buffer. * * Data is processed in 16 bytes packages. Each package is a STPv2 frame which @@ -510,6 +97,7 @@ static void process(void) { static const uint32_t *const etr_buf = (uint32_t *)(DT_REG_ADDR(ETR_BUFFER_NODE)); static uint32_t sync_cnt; + int err; uint32_t pending; /* If function is called in panic mode then it may interrupt ongoing @@ -525,7 +113,7 @@ static void process(void) if (sync_cnt || (CONFIG_NRF_ETR_SYNC_PERIOD == 0)) { sync_cnt--; sys_cache_data_invd_range((void *)&etr_buf[etr_rd_idx & wsize_mask], - CORESIGHT_TRACE_FRAME_SIZE); + FRAME_SIZE8); for (int i = 0; i < CORESIGHT_TRACE_FRAME_SIZE32; i++) { frame_buf[i] = etr_buf[(etr_rd_idx + i) & wsize_mask]; } @@ -533,26 +121,21 @@ static void process(void) __sync_synchronize(); } else { sync_cnt = CONFIG_NRF_ETR_SYNC_PERIOD; - memset(frame_buf, 0xff, CORESIGHT_TRACE_FRAME_SIZE); + memset(frame_buf, 0xff, FRAME_SIZE8); } - if (IS_ENABLED(CONFIG_NRF_ETR_DECODE) || IS_ENABLED(CONFIG_NRF_ETR_DEBUG)) { - if ((pending >= (wsize_mask - MIN_DATA)) || - (pending_data() >= (wsize_mask - MIN_DATA))) { - /* If before or after reading the frame it is close to full - * then assume overwrite and sync loss. - */ - sync_loss(); - } + if (use_async_uart) { + err = k_sem_take(&uart_sem, K_FOREVER); + __ASSERT_NO_MSG(err >= 0); - process_frame((uint8_t *)frame_buf, pending); - if (IS_ENABLED(CONFIG_NRF_ETR_DECODE)) { - process_messages(); - } + err = uart_tx(uart_dev, (uint8_t *)frame_buf, FRAME_SIZE8, SYS_FOREVER_US); + __ASSERT_NO_MSG(err >= 0); + /* Switch buffers to prevent overwriting data which is being sent. */ + frame_buf = (frame_buf == frame_buf0) ? frame_buf1 : frame_buf0; } else { - dump_frame((uint8_t *)frame_buf); - frame_buf = (use_async_uart && (frame_buf == frame_buf0)) ? - frame_buf1 : frame_buf0; + for (int i = 0; i < FRAME_SIZE8; i++) { + uart_poll_out(uart_dev, ((uint8_t *)frame_buf)[i]); + } } } @@ -562,88 +145,44 @@ static void process(void) } } -static int decoder_init(void) +int etr_dump_flush(bool blocking) { - int err; - static bool once; - - if (once) { - return -EALREADY; - } - - once = true; - if (IS_ENABLED(CONFIG_NRF_ETR_DECODE)) { - static const struct log_frontend_stmesp_demux_config config = {.m_ids = stm_m_id, - .m_ids_cnt = ARRAY_SIZE(stm_m_id)}; + if (blocking) { + int cnt = 4; + /* Set flag which forces uart to use blocking polling out instead of + * asynchronous API. + */ + use_async_uart = false; + uint32_t k = irq_lock(); - err = log_frontend_stmesp_demux_init(&config); - if (err < 0) { - return err; + /* Repeat arbitrary number of times to ensure that all that is flushed. */ + while (cnt--) { + process(); } - } - - static const struct mipi_stp_decoder_config stp_decoder_cfg = {.cb = decoder_cb, - .start_out_of_sync = true}; - - mipi_stp_decoder_init(&stp_decoder_cfg); - cs_trace_defmt_init(deformatter_cb); + irq_unlock(k); - return 0; -} - -void nrf_etr_flush(void) -{ - int cnt = 4; + return 0; + } - if (IS_ENABLED(CONFIG_NRF_ETR_DECODE) || - IS_ENABLED(CONFIG_NRF_ETR_DEBUG)) { - (void)decoder_init(); + if (!k_is_preempt_thread()) { + return -ENOTSUP; } - /* Set flag which forces uart to use blocking polling out instead of - * asynchronous API. + /* Due to writing dummy data there is always some data pending so use arbitrary + * value to decide that majority of data is flushed. */ - use_async_uart = false; - uint32_t k = irq_lock(); - - /* Repeat arbitrary number of times to ensure that all that is flushed. */ - while (cnt--) { - process(); + while (pending_data() >= 2 * MIN_DATA) { + k_msleep(CONFIG_NRF_ETR_FLUSH_TIMEOUT); } - irq_unlock(k); + return 0; } static void etr_thread_func(void *dummy1, void *dummy2, void *dummy3) { - uint64_t checkpoint = 0; - - if (IS_ENABLED(CONFIG_NRF_ETR_DECODE) || - IS_ENABLED(CONFIG_NRF_ETR_DEBUG)) { - int err; - - err = decoder_init(); - if (err < 0) { - return; - } - } - while (1) { process(); - - uint64_t now = k_uptime_get(); - - if (DROP_CHECK_PERIOD && (now - checkpoint) > DROP_CHECK_PERIOD) { - uint32_t cnt = log_frontend_stmesp_demux_get_dropped(); - - checkpoint = now; - if (cnt || oosync_cnt) { - oosync_cnt = 0; - LOG_WRN("Too many log messages, some dropped"); - } - } - k_sleep(K_MSEC(CONFIG_NRF_ETR_BACKOFF)); } } diff --git a/include/zephyr/drivers/misc/coresight/nrf_etr.h b/include/zephyr/drivers/misc/coresight/nrf_etr.h deleted file mode 100644 index 062afa3b61a..00000000000 --- a/include/zephyr/drivers/misc/coresight/nrf_etr.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef _ZEPHYR_DRIVERS_MISC_CORESIGHT_NRF_ETR_H_ -#define _ZEPHYR_DRIVERS_MISC_CORESIGHT_NRF_ETR_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/** @brief Flush data from the ETR buffer. */ -void nrf_etr_flush(void); - -#ifdef __cplusplus -} -#endif - -#endif /* _ZEPHYR_DRIVERS_MISC_CORESIGHT_NRF_ETR_H_ */ From 39f162883dad4e58db7034416b0e52ca63a014fb Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 060/825] Revert "[nrf fromtree] tests: logging: Add test for log_frontend_stpesp_demux" This reverts commit 357e6dee9fd0095be761588aca7376542cc3ff22. --- .../log_frontend_stmesp_demux/CMakeLists.txt | 8 - .../logging/log_frontend_stmesp_demux/README | 1 - .../log_frontend_stmesp_demux/prj.conf | 8 - .../log_frontend_stmesp_demux/src/main.c | 474 ------------------ .../log_frontend_stmesp_demux/testcase.yaml | 11 - 5 files changed, 502 deletions(-) delete mode 100644 tests/subsys/logging/log_frontend_stmesp_demux/CMakeLists.txt delete mode 100644 tests/subsys/logging/log_frontend_stmesp_demux/README delete mode 100644 tests/subsys/logging/log_frontend_stmesp_demux/prj.conf delete mode 100644 tests/subsys/logging/log_frontend_stmesp_demux/src/main.c delete mode 100644 tests/subsys/logging/log_frontend_stmesp_demux/testcase.yaml diff --git a/tests/subsys/logging/log_frontend_stmesp_demux/CMakeLists.txt b/tests/subsys/logging/log_frontend_stmesp_demux/CMakeLists.txt deleted file mode 100644 index 0e857875011..00000000000 --- a/tests/subsys/logging/log_frontend_stmesp_demux/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(stp_demux) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/tests/subsys/logging/log_frontend_stmesp_demux/README b/tests/subsys/logging/log_frontend_stmesp_demux/README deleted file mode 100644 index b9905edacc1..00000000000 --- a/tests/subsys/logging/log_frontend_stmesp_demux/README +++ /dev/null @@ -1 +0,0 @@ -Test for demultiplexer of log messages encoded in STPv2 data stream. diff --git a/tests/subsys/logging/log_frontend_stmesp_demux/prj.conf b/tests/subsys/logging/log_frontend_stmesp_demux/prj.conf deleted file mode 100644 index 9af91fedfd2..00000000000 --- a/tests/subsys/logging/log_frontend_stmesp_demux/prj.conf +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_ZTEST=y -CONFIG_LOG_FRONTEND=y -CONFIG_LOG=y -CONFIG_LOG_PRINTK=n -CONFIG_TEST_LOGGING_DEFAULTS=n -CONFIG_LOG_FRONTEND_STMESP_DEMUX=y -CONFIG_LOG_FRONTEND_STMESP_DEMUX_BUFFER_SIZE=256 -CONFIG_LOG_FRONTEND_STMESP_DEMUX_ACTIVE_PACKETS=3 diff --git a/tests/subsys/logging/log_frontend_stmesp_demux/src/main.c b/tests/subsys/logging/log_frontend_stmesp_demux/src/main.c deleted file mode 100644 index d94956da285..00000000000 --- a/tests/subsys/logging/log_frontend_stmesp_demux/src/main.c +++ /dev/null @@ -1,474 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA. - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include -#include -#include - -#define M_HW 0x80 -#define M_ID0 0x30 -#define M_ID1 0x3131 -#define M_ID2 0x20 - -#define TOTAL_LEN(len) \ - ROUND_UP(len + offsetof(struct log_frontend_stmesp_demux_log, data), 2 * sizeof(uint32_t)) -#define TOTAL_WLEN(len) (TOTAL_LEN(len) / sizeof(uint32_t)) - -static const uint16_t ids[] = {M_ID0, M_ID1, M_ID2, M_HW}; - -void log_frontend_init(void) -{ - /* empty */ -} - -void log_frontend_msg(const void *source, const struct log_msg_desc desc, uint8_t *package, - const void *data) -{ - /* empty */ -} - -void log_frontend_panic(void) -{ - /* empty */ -} - -static void claim_packet(uint16_t exp_m_idx, uint64_t exp_ts, uint16_t exp_len, uint8_t exp_id, - int line) -{ - union log_frontend_stmesp_demux_packet packet = log_frontend_stmesp_demux_claim(); - - if (packet.generic == NULL) { - zassert_equal(exp_len, 0, "%d: Expected a packet", line); - return; - } - - zassert_equal(packet.generic_packet->type, LOG_FRONTEND_STMESP_DEMUX_TYPE_LOG); - zassert_equal(exp_ts, packet.log->timestamp, "%d: Unexpected ts %llu/%x (exp:%llu/%x)", - line, packet.log->timestamp, packet.log->timestamp, exp_ts, exp_ts); - zassert_equal(exp_m_idx, ids[packet.log->hdr.major], "%d: Unexpected major:%d (exp:%d)", - line, packet.log->hdr.major, exp_m_idx); - zassert_equal(exp_len, packet.log->hdr.total_len, "%d: Unexpected len:%d (exp:%d)", line, - packet.log->hdr.total_len, exp_len); - for (int i = 0; i < exp_len; i++) { - zassert_equal(packet.log->data[i], i + exp_id, - "%d: Unexpected data(%d) at %d index (exp:%d)", line, - packet.log->data[i], i, i + exp_id); - } - - log_frontend_stmesp_demux_free(packet); -} - -#define CLAIM_PACKET(_exp_m_idx, _exp_ts, _exp_len, _exp_id) \ - claim_packet(_exp_m_idx, _exp_ts, _exp_len, _exp_id, __LINE__) - -static void claim_trace_point(uint16_t exp_m_idx, uint16_t exp_id, uint64_t exp_ts, - uint32_t *exp_data, int line) -{ - union log_frontend_stmesp_demux_packet packet = log_frontend_stmesp_demux_claim(); - - zassert_equal(packet.generic_packet->type, LOG_FRONTEND_STMESP_DEMUX_TYPE_TRACE_POINT); - zassert_equal(exp_ts, packet.trace_point->timestamp, - "%d: Unexpected ts %llu/%x (exp:%llu/%x)", line, - packet.trace_point->timestamp, packet.trace_point->timestamp, exp_ts, exp_ts); - zassert_equal(exp_id, packet.trace_point->id, "%d: Unexpected id:%d (exp:%d)", line, - packet.trace_point->id, exp_id); - zassert_equal(exp_m_idx, ids[packet.trace_point->major], - "%d: Unexpected major:%d (exp:%d)", line, packet.trace_point->major, - exp_m_idx); - if (exp_data) { - zassert_equal(1, packet.trace_point->has_data); - zassert_equal(*exp_data, packet.trace_point->data, - "%d: Unexpected data:%d (exp:%d)", line, packet.trace_point->data, - *exp_data); - } else { - zassert_equal(0, packet.trace_point->has_data); - } - - log_frontend_stmesp_demux_free(packet); -} - -#define CLAIM_TRACE_POINT(_exp_m_idx, _exp_id, _exp_ts, _exp_data) \ - claim_trace_point(_exp_m_idx, _exp_id, _exp_ts, _exp_data, __LINE__) - -static void claim_hw_event(uint8_t exp_evt, uint64_t exp_ts, int line) -{ - union log_frontend_stmesp_demux_packet packet = log_frontend_stmesp_demux_claim(); - - zassert_equal(packet.generic_packet->type, LOG_FRONTEND_STMESP_DEMUX_TYPE_HW_EVENT); - zassert_equal(exp_ts, packet.hw_event->timestamp, "%d: Unexpected ts %llu/%x (exp:%llu/%x)", - line, packet.hw_event->timestamp, packet.hw_event->timestamp, exp_ts, exp_ts); - zassert_equal(exp_evt, packet.hw_event->evt, "%d: Unexpected id:%d (exp:%d)", line, - packet.hw_event->evt, exp_evt); - - log_frontend_stmesp_demux_free(packet); -} - -#define CLAIM_HW_EVENT(_exp_evt, _exp_ts) claim_hw_event(_exp_evt, _exp_ts, __LINE__) - -#define DEMUX_EMPTY() CLAIM_PACKET(0, 0, 0, 0) - -static int write_trace_point(uint16_t *m_id, uint16_t *c_id, uint32_t *data, uint64_t ts) -{ - if (m_id) { - log_frontend_stmesp_demux_major(*m_id); - } - - if (c_id) { - log_frontend_stmesp_demux_channel(*c_id); - } - - return log_frontend_stmesp_demux_packet_start(data, &ts); -} - -static int write_hw_event(uint8_t evt, uint64_t ts) -{ - uint32_t data = (uint32_t)evt; - - log_frontend_stmesp_demux_major(M_HW); - - return log_frontend_stmesp_demux_packet_start(&data, &ts); -} - -static void packet_start(uint16_t *m_id, uint16_t *c_id, uint32_t data, uint64_t ts, int exp_rv, - int line) -{ - int rv; - - if (m_id) { - log_frontend_stmesp_demux_major(*m_id); - } - - if (c_id) { - log_frontend_stmesp_demux_channel(*c_id); - } - - rv = log_frontend_stmesp_demux_packet_start(&data, &ts); - zassert_equal(rv, exp_rv, "%d: Unexpected ret:%d (exp:%d)", line, rv, exp_rv); -} -#define PACKET_START(_m_id, _c_id, _data, _ts, _exp_rv) \ - packet_start(_m_id, _c_id, _data, _ts, _exp_rv, __LINE__) - -static void packet_data(uint16_t *m_id, uint16_t *c_id, uint8_t *data, size_t len) -{ - if (m_id) { - log_frontend_stmesp_demux_major(*m_id); - } - - if (c_id) { - log_frontend_stmesp_demux_channel(*c_id); - } - - log_frontend_stmesp_demux_data(data, len); -} - -static void packet_end(uint16_t *m_id, uint16_t *c_id) -{ - if (m_id) { - log_frontend_stmesp_demux_major(*m_id); - } - - if (c_id) { - log_frontend_stmesp_demux_channel(*c_id); - } - - log_frontend_stmesp_demux_packet_end(); -} - -static void write_data(uint16_t len, uint8_t id) -{ - for (int i = 0; i < len; i++) { - uint8_t d = i + id; - - log_frontend_stmesp_demux_data(&d, 1); - } -} - -static void write_packet(uint16_t m_id, uint16_t c_id, uint64_t ts, uint16_t len, uint8_t id) -{ - union log_frontend_stmesp_demux_header hdr = {.log = {.total_len = len}}; - - log_frontend_stmesp_demux_major(m_id); - log_frontend_stmesp_demux_channel(c_id); - log_frontend_stmesp_demux_packet_start(&hdr.raw, NULL); - log_frontend_stmesp_demux_timestamp(ts); - write_data(len, id); - log_frontend_stmesp_demux_packet_end(); -} - -static void demux_init(void) -{ - struct log_frontend_stmesp_demux_config config = {.m_ids = ids, - .m_ids_cnt = ARRAY_SIZE(ids)}; - int err; - - err = log_frontend_stmesp_demux_init(&config); - zassert_equal(err, 0, NULL); -} - -ZTEST(log_frontend_stmesp_demux_test, test_init) -{ - /* Ids limit is 8 */ - static const uint16_t m_ids[9] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; - struct log_frontend_stmesp_demux_config config = {.m_ids = m_ids, - .m_ids_cnt = ARRAY_SIZE(m_ids)}; - int err; - - err = log_frontend_stmesp_demux_init(&config); - zassert_equal(err, -EINVAL, NULL); - - config.m_ids_cnt = 8; - err = log_frontend_stmesp_demux_init(&config); - zassert_equal(err, 0, NULL); -} - -ZTEST(log_frontend_stmesp_demux_test, test_basic) -{ - uint16_t m = M_ID0; - uint16_t c = 0; - uint8_t data = 1; - - demux_init(); - - /* Writing to packet that was not started has no effect. */ - packet_data(&m, &c, &data, 1); - packet_end(&m, &c); - - write_packet(M_ID0, 1, 1, 10, 1); - write_packet(M_ID0, 2, 2, 10, 2); - write_packet(M_ID1, 1, 3, 10, 3); - - CLAIM_PACKET(M_ID0, 1, 10, 1); - CLAIM_PACKET(M_ID0, 2, 10, 2); - CLAIM_PACKET(M_ID1, 3, 10, 3); - - DEMUX_EMPTY(); - - zassert_equal(log_frontend_stmesp_demux_get_dropped(), 0, NULL); -} - -ZTEST(log_frontend_stmesp_demux_test, test_overwrite) -{ - uint64_t ts = 0; - uint32_t len = 10; - uint32_t total_wlen = TOTAL_WLEN(len); - int i; - - demux_init(); - - for (i = 0; i < (CONFIG_LOG_FRONTEND_STMESP_DEMUX_BUFFER_SIZE / total_wlen); i++) { - write_packet(M_ID0, 1, ts + i, len, i); - } - zassert_equal(log_frontend_stmesp_demux_get_dropped(), 0, NULL); - - write_packet(M_ID0, 1, ts + i, len, i); - - uint32_t dropped = log_frontend_stmesp_demux_get_dropped(); - - zassert_true(dropped >= 1, NULL); - - for (i = dropped; i < (CONFIG_LOG_FRONTEND_STMESP_DEMUX_BUFFER_SIZE / total_wlen) + 1; - i++) { - CLAIM_PACKET(M_ID0, ts + i, len, i); - } - - DEMUX_EMPTY(); -} - -ZTEST(log_frontend_stmesp_demux_test, test_mix) -{ - uint16_t m_id = M_ID0; - uint16_t c_id0 = 2; - uint16_t c_id1 = 1; - uint64_t ts0 = 0x1234567890; - uint64_t ts1 = 0x3434343445; - int len0 = 12; - int len1 = 14; - union log_frontend_stmesp_demux_header hdr0 = {.log = {.total_len = len0}}; - union log_frontend_stmesp_demux_header hdr1 = {.log = {.total_len = len1}}; - - zassert_true(c_id0 != CONFIG_LOG_FRONTEND_STMESP_FLUSH_PORT_ID); - zassert_true(c_id1 != CONFIG_LOG_FRONTEND_STMESP_FLUSH_PORT_ID); - - demux_init(); - - /* Write 2 packets mixing them. */ - PACKET_START(&m_id, &c_id0, hdr0.raw, ts0, 0); - - PACKET_START(&m_id, &c_id1, hdr1.raw, ts1, 0); - packet_data(&m_id, &c_id0, NULL, 0); - write_data(len0, 0); - packet_data(&m_id, &c_id1, NULL, 0); - write_data(len1, 1); - packet_end(&m_id, &c_id0); - packet_end(&m_id, &c_id1); - - /* Expect demuxed packets. */ - CLAIM_PACKET(M_ID0, ts0, len0, 0); - CLAIM_PACKET(M_ID0, ts1, len1, 1); - - DEMUX_EMPTY(); -} - -ZTEST(log_frontend_stmesp_demux_test, test_drop_too_many_active) -{ - BUILD_ASSERT(CONFIG_LOG_FRONTEND_STMESP_DEMUX_ACTIVE_PACKETS == 3, - "Test assumes certain configuration"); - - uint16_t m_id0 = M_ID0; - uint16_t m_id1 = M_ID1; - uint16_t c_id0 = 2; - uint16_t c_id1 = 1; - int len = 4; - uint64_t ts = 0; - uint8_t data[] = {1, 2, 3, 4}; - union log_frontend_stmesp_demux_header hdr = {.log = {.total_len = len}}; - - zassert_true(c_id0 != CONFIG_LOG_FRONTEND_STMESP_FLUSH_PORT_ID); - zassert_true(c_id1 != CONFIG_LOG_FRONTEND_STMESP_FLUSH_PORT_ID); - - demux_init(); - - PACKET_START(NULL, NULL, hdr.raw, ts, -EINVAL); - - /* Start writing to 3 packets */ - PACKET_START(&m_id0, &c_id0, hdr.raw, ts, 0); - packet_data(NULL, NULL, data, 1); - PACKET_START(&m_id0, &c_id1, hdr.raw, ts + 1, 0); - PACKET_START(&m_id1, &c_id0, hdr.raw, ts + 2, 0); - packet_data(NULL, NULL, data, 1); - - zassert_equal(log_frontend_stmesp_demux_get_dropped(), 0, NULL); - /* Starting forth packet results in dropping. */ - PACKET_START(&m_id1, &c_id1, hdr.raw, ts + 3, -ENOMEM); - zassert_equal(log_frontend_stmesp_demux_get_dropped(), 1, NULL); - - /* Complete first packet. */ - packet_data(&m_id0, &c_id0, &data[1], 3); - packet_end(NULL, NULL); - - PACKET_START(&m_id1, &c_id1, hdr.raw, ts + 3, 0); - zassert_equal(log_frontend_stmesp_demux_get_dropped(), 0, NULL); -} - -ZTEST(log_frontend_stmesp_demux_test, test_max_utilization) -{ - int utilization; - uint32_t len = 10; - - if (!IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP_DEMUX_MAX_UTILIZATION)) { - utilization = log_frontend_stmesp_demux_max_utilization(); - zassert_equal(utilization, -ENOTSUP, NULL); - return; - } - - demux_init(); - utilization = log_frontend_stmesp_demux_max_utilization(); - zassert_equal(utilization, 0, NULL); - - write_packet(M_ID0, 0, 1, len, 1); - utilization = log_frontend_stmesp_demux_max_utilization(); - - int exp_utilization = TOTAL_LEN(len); - - zassert_equal(utilization, exp_utilization, NULL); -} - -ZTEST(log_frontend_stmesp_demux_test, test_trace_point) -{ - uint16_t m_id0 = M_ID0; - uint16_t m_id1 = M_ID1; - uint16_t id0 = 2; - uint16_t id1 = 0; - uint16_t c_id0 = CONFIG_LOG_FRONTEND_STMESP_TP_CHAN_BASE + id0; - uint16_t c_id1 = CONFIG_LOG_FRONTEND_STMESP_TP_CHAN_BASE + id1; - uint32_t data = 0x11223344; - uint64_t t0 = 0x1122334455; - uint64_t t1 = 0x5522334455; - int err; - - demux_init(); - - err = write_trace_point(&m_id0, &c_id0, NULL, t0); - zassert_equal(err, 1); - - err = write_trace_point(NULL, &c_id0, NULL, t0); - zassert_equal(err, 1); - - err = write_trace_point(NULL, &c_id0, &data, t0); - zassert_equal(err, 1); - - err = write_trace_point(NULL, &c_id1, &data, t1); - zassert_equal(err, 1); - - err = write_trace_point(&m_id1, &c_id0, NULL, t0); - zassert_equal(err, 1); - - err = write_trace_point(&m_id1, &c_id1, NULL, t1); - zassert_equal(err, 1); - - CLAIM_TRACE_POINT(m_id0, id0, t0, NULL); - CLAIM_TRACE_POINT(m_id0, id0, t0, NULL); - CLAIM_TRACE_POINT(m_id0, id0, t0, &data); - CLAIM_TRACE_POINT(m_id0, id1, t1, &data); - CLAIM_TRACE_POINT(m_id1, id0, t0, NULL); - CLAIM_TRACE_POINT(m_id1, id1, t1, NULL); - - DEMUX_EMPTY(); -} - -ZTEST(log_frontend_stmesp_demux_test, test_hw_event) -{ - uint64_t t0 = 0x1122334455; - uint64_t t1 = 0x5522334455; - int err; - - demux_init(); - - err = write_hw_event(0, t0); - zassert_equal(err, 1); - - err = write_hw_event(1, t1); - zassert_equal(err, 1); - - CLAIM_HW_EVENT(0, t0); - CLAIM_HW_EVENT(1, t1); - - DEMUX_EMPTY(); -} - -ZTEST(log_frontend_stmesp_demux_test, test_reset) -{ - uint16_t m_id0 = M_ID0; - uint16_t m_id1 = M_ID1; - uint16_t c_id0 = 2; - uint16_t c_id1 = 1; - int len = 4; - uint64_t ts = 0; - uint8_t data[] = {1, 2, 3, 4}; - union log_frontend_stmesp_demux_header hdr = {.log = {.total_len = len}}; - - zassert_true(c_id0 != CONFIG_LOG_FRONTEND_STMESP_FLUSH_PORT_ID); - zassert_true(c_id1 != CONFIG_LOG_FRONTEND_STMESP_FLUSH_PORT_ID); - - demux_init(); - - PACKET_START(NULL, NULL, hdr.raw, ts, -EINVAL); - - /* Start writing to 3 packets */ - PACKET_START(&m_id0, &c_id0, hdr.raw, ts, 0); - packet_data(NULL, NULL, data, 1); - PACKET_START(&m_id0, &c_id1, hdr.raw, ts + 1, 0); - PACKET_START(&m_id1, &c_id0, hdr.raw, ts + 2, 0); - packet_data(NULL, NULL, data, 4); - packet_end(NULL, NULL); - - log_frontend_stmesp_demux_reset(); - zassert_equal(log_frontend_stmesp_demux_get_dropped(), 2, NULL); - - CLAIM_PACKET(M_ID1, ts + 2, len, 1); - DEMUX_EMPTY(); -} - -ZTEST_SUITE(log_frontend_stmesp_demux_test, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/subsys/logging/log_frontend_stmesp_demux/testcase.yaml b/tests/subsys/logging/log_frontend_stmesp_demux/testcase.yaml deleted file mode 100644 index 4bf1c36dfb4..00000000000 --- a/tests/subsys/logging/log_frontend_stmesp_demux/testcase.yaml +++ /dev/null @@ -1,11 +0,0 @@ -common: - filter: not CONFIG_BIG_ENDIAN -tests: - debug.coresight.stp_demux: - integration_platforms: - - native_posix - debug.coresight.stp_demux_max_utilization: - integration_platforms: - - native_posix - extra_configs: - - CONFIG_LOG_FRONTEND_STMESP_DEMUX_MAX_UTILIZATION=y From 6064efcb36d6b50dec51b54955d12429b47149d8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 061/825] Revert "[nrf fromtree] logging: Add demultiplexer for log_frontend_stmesp" This reverts commit 58d4842dd0a68806c694f4ef7a9224e0d5e3b3ca. --- .../logging/log_frontend_stmesp_demux.h | 282 ------------ subsys/logging/frontends/CMakeLists.txt | 5 - subsys/logging/frontends/Kconfig | 34 +- .../frontends/log_frontend_stmesp_demux.c | 402 ------------------ 4 files changed, 4 insertions(+), 719 deletions(-) delete mode 100644 include/zephyr/logging/log_frontend_stmesp_demux.h delete mode 100644 subsys/logging/frontends/log_frontend_stmesp_demux.c diff --git a/include/zephyr/logging/log_frontend_stmesp_demux.h b/include/zephyr/logging/log_frontend_stmesp_demux.h deleted file mode 100644 index 058ff48ad95..00000000000 --- a/include/zephyr/logging/log_frontend_stmesp_demux.h +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_LOGGING_LOG_FRONTEND_STMESP_DEMUX_H_ -#define ZEPHYR_INCLUDE_LOGGING_LOG_FRONTEND_STMESP_DEMUX_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup log_frontend_stmesp_apis Trace and Debug Domain APIs - * @{ - * @} - * @defgroup log_frontend_stpesp_demux_apis Logging frontend STMESP Demultiplexer API - * @ingroup log_frontend_stmesp_apis - * @{ - */ - -/** @brief Bits used to store major index. */ -#define LOG_FRONTEND_STMESP_DEMUX_MAJOR_BITS 3 - -/** @brief Bits used to store severity level. */ -#define LOG_FRONTEND_STMESP_DEMUX_LEVEL_BITS 3 - -/** @brief Bits used to store total length. */ -#define LOG_FRONTEND_STMESP_DEMUX_TLENGTH_BITS 16 - -/** @brief Bits used to store package length. */ -#define LOG_FRONTEND_STMESP_DEMUX_PLENGTH_BITS 10 - -/** @brief Maximum number of supported majors. */ -#define LOG_FRONTEND_STMESP_DEMUX_MAJOR_MAX BIT(LOG_FRONTEND_STMESP_DEMUX_MAJOR_BITS) - -/** @brief Log message type. */ -#define LOG_FRONTEND_STMESP_DEMUX_TYPE_LOG 0 - -/** @brief Trace point message type. */ -#define LOG_FRONTEND_STMESP_DEMUX_TYPE_TRACE_POINT 1 - -/** @brief HW event message type. */ -#define LOG_FRONTEND_STMESP_DEMUX_TYPE_HW_EVENT 2 - -/** @brief Logging message header. */ -struct log_frontend_stmesp_demux_log_header { - /** Major index. */ - uint32_t major : LOG_FRONTEND_STMESP_DEMUX_MAJOR_BITS; - - /** Severity level. */ - uint32_t level : LOG_FRONTEND_STMESP_DEMUX_LEVEL_BITS; - - /** Total length excluding this header. */ - uint32_t total_len : LOG_FRONTEND_STMESP_DEMUX_TLENGTH_BITS; - - /** Hexdump data length. */ - uint32_t package_len : LOG_FRONTEND_STMESP_DEMUX_PLENGTH_BITS; -}; - -/** @brief Union for writing raw data to the logging message header. */ -union log_frontend_stmesp_demux_header { - /** Log header structure. */ - struct log_frontend_stmesp_demux_log_header log; - - /** Raw word. */ - uint32_t raw; -}; - -/** @brief Generic STP demux packet. */ -struct log_frontend_stmesp_demux_packet_generic { - /** Data for MPSC packet handling. */ - MPSC_PBUF_HDR; - - /** Type. */ - uint64_t type: 2; - - /** Flag indicating if packet is valid. */ - uint64_t content_invalid: 1; -}; - -/** @brief Packet with logging message. */ -struct log_frontend_stmesp_demux_log { - /** Data for MPSC packet handling. */ - MPSC_PBUF_HDR; - - /** Type. */ - uint64_t type: 2; - - /** Flag indicating if packet is valid. */ - uint64_t content_invalid: 1; - - /** Timestamp. */ - uint64_t timestamp: 59; - - /** Logging header. */ - struct log_frontend_stmesp_demux_log_header hdr; - - /** Padding so that data is 8 bytes aligned. */ - uint32_t padding; - - /** Content. */ - uint8_t data[]; -}; - -/** @brief Packet with trace point. */ -struct log_frontend_stmesp_demux_trace_point { - /** Data for MPSC packet handling. */ - MPSC_PBUF_HDR; - - /** Type. */ - uint64_t type: 2; - - /** Flag indicating if packet is valid. */ - uint64_t content_invalid: 1; - - /** Flag indicating if trace point includes data. */ - uint64_t has_data: 1; - - /** Timestamp. */ - uint64_t timestamp: 58; - - /** Major ID. */ - uint16_t major; - - /** ID */ - uint16_t id; - - /** Content. */ - uint32_t data; -}; - -/** @brief Packet with HW event. */ -struct log_frontend_stmesp_demux_hw_event { - /** Data for MPSC packet handling. */ - MPSC_PBUF_HDR; - - /** Type. */ - uint64_t type: 2; - - /** Flag indicating if packet is valid. */ - uint64_t content_invalid: 1; - - /** Timestamp. */ - uint64_t timestamp: 59; - - /** HW event ID. */ - uint8_t evt; -}; - -/** @brief Union of all packet types. */ -union log_frontend_stmesp_demux_packet { - /** Pointer to generic mpsc_pbuf const packet. */ - const union mpsc_pbuf_generic *rgeneric; - - /** Pointer to generic mpsc_pbuf packet. */ - union mpsc_pbuf_generic *generic; - - /** Pointer to the log message. */ - struct log_frontend_stmesp_demux_log *log; - - /** Pointer to the trace point message. */ - struct log_frontend_stmesp_demux_trace_point *trace_point; - - /** Pointer to the HW event message. */ - struct log_frontend_stmesp_demux_hw_event *hw_event; - - /** Pointer to the generic log_frontend_stmesp_demux packet. */ - struct log_frontend_stmesp_demux_packet_generic *generic_packet; -}; - -/** @brief Demultiplexer configuration. */ -struct log_frontend_stmesp_demux_config { - /** Array with expected major ID's. */ - const uint16_t *m_ids; - - /** Array length. Must be not bigger than @ref LOG_FRONTEND_STMESP_DEMUX_MAJOR_MAX. */ - uint32_t m_ids_cnt; -}; - -/** @brief Initialize the demultiplexer. - * - * @param config Configuration. - * - * @retval 0 on success. - * @retval -EINVAL on invalid configuration. - */ -int log_frontend_stmesp_demux_init(const struct log_frontend_stmesp_demux_config *config); - -/** @brief Indicate major opcode in the STPv2 stream. - * - * @param id Master ID. - */ -void log_frontend_stmesp_demux_major(uint16_t id); - -/** @brief Indicate channel opcode in the STPv2 stream. - * - * @param id Channel ID. - */ -void log_frontend_stmesp_demux_channel(uint16_t id); - -/** @brief Indicate detected packet start (DMTS). - * - * @param data Data. Can be NULL which indicates trace point without data. - * @param ts Timestamp. Can be NULL. - */ -int log_frontend_stmesp_demux_packet_start(uint32_t *data, uint64_t *ts); - -/** @brief Indicate timestamp. - * - * Timestamp is separated from packet start because according to STM spec (3.2.2) - * it is possible that timestamp is assigned to a later packet. - * - * @param ts Timestamp. - */ -void log_frontend_stmesp_demux_timestamp(uint64_t ts); - -/** @brief Indicate data. - * - * @param data Data buffer. - * @param len Length. - */ -void log_frontend_stmesp_demux_data(uint8_t *data, size_t len); - -/** @brief Indicate packet end (Flag). */ -void log_frontend_stmesp_demux_packet_end(void); - -/** @brief Get number of dropped messages and reset the counter. - * - * Message can be dropped if there is no room in the packet buffer. - * - * @return Number of dropped messages. - */ -uint32_t log_frontend_stmesp_demux_get_dropped(void); - -/** @brief Claim packet. - * - * Get pointer to the pending packet with logging message. Packet must be freed - * using @ref log_frontend_stmesp_demux_free. - * - * @return Pointer to the packet or NULL. - */ -union log_frontend_stmesp_demux_packet log_frontend_stmesp_demux_claim(void); - -/** @brief Free previously claimed packet. - * - * See @ref log_frontend_stmesp_demux_claim. - * - * @param packet Packet. - */ -void log_frontend_stmesp_demux_free(union log_frontend_stmesp_demux_packet packet); - -/** @brief Check if there are any started but not completed log messages. - * - * @retval True There is no pending started log message. - * @retval False There is pending message. - */ -bool log_frontend_stmesp_demux_is_idle(void); - -/** @brief Close any opened messages and mark them as invalid. */ -void log_frontend_stmesp_demux_reset(void); - -/** @brief Get maximum buffer utilization. - * - * @retval Non-negative Maximum buffer utilization. - * @retval -ENOTSUP Feature not enabled. - */ -int log_frontend_stmesp_demux_max_utilization(void); - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_INCLUDE_LOGGING_LOG_FRONTEND_STMESP_DEMUX_H_ */ diff --git a/subsys/logging/frontends/CMakeLists.txt b/subsys/logging/frontends/CMakeLists.txt index fbe118e7243..a6f97605f7c 100644 --- a/subsys/logging/frontends/CMakeLists.txt +++ b/subsys/logging/frontends/CMakeLists.txt @@ -9,8 +9,3 @@ zephyr_sources_ifdef( CONFIG_LOG_FRONTEND_STMESP log_frontend_stmesp.c ) - -zephyr_sources_ifdef( - CONFIG_LOG_FRONTEND_STMESP_DEMUX - log_frontend_stmesp_demux.c -) diff --git a/subsys/logging/frontends/Kconfig b/subsys/logging/frontends/Kconfig index c75ec51e52c..dd8d12c2ad8 100644 --- a/subsys/logging/frontends/Kconfig +++ b/subsys/logging/frontends/Kconfig @@ -51,6 +51,9 @@ config LOG_FRONTEND_STMESP_FLUSH_COUNT Before going to sleep CPU shall write to STM some dummy data to ensure that any buffered data goes to TPIU/ETR. +config LOG_FRONTEND_STMESP_FLUSH_PORT_ID + def_int 0 + config LOG_FRONTEND_STMESP_EARLY_BUF_SIZE int "Buffer size to store early messages" default 0 @@ -68,40 +71,11 @@ config LOG_FRONTEND_STMESP_GUARANTEED_ACCESS When enabled, accessing STMESP registers will stall if write cannot be performed (e.g. ETR buffer is full). -endif # LOG_FRONTEND_STMESP - -config LOG_FRONTEND_STMESP_DEMUX - bool "Demultiplexer of logging packets from STM stream" - select MPSC_PBUF - help - Module demultiplexes messages encoded in STPv2 stream. Messages may - be interleaved because they may come from multiple cores (majors). - There are 3 types of messages: logging, tracepoints and HW events. - -if LOG_FRONTEND_STMESP_DEMUX - -config LOG_FRONTEND_STMESP_DEMUX_ACTIVE_PACKETS - int "Active packets" - default 12 - -config LOG_FRONTEND_STMESP_DEMUX_BUFFER_SIZE - int "Buffer size" - default 1024 - -config LOG_FRONTEND_STMESP_DEMUX_MAX_UTILIZATION - bool "Track maximum utilization" - -endif # LOG_FRONTEND_STMESP_DEMUX - -config LOG_FRONTEND_STMESP_FLUSH_PORT_ID - def_int 0 - depends on LOG_FRONTEND_STMESP_DEMUX || LOG_FRONTEND_STMESP - config LOG_FRONTEND_STMESP_TP_CHAN_BASE def_int 255 - depends on LOG_FRONTEND_STMESP_DEMUX || LOG_FRONTEND_STMESP help Do not change this value as it is aligned with host decoder (nrfutil trace). +endif # LOG_FRONTEND_STMESP endmenu diff --git a/subsys/logging/frontends/log_frontend_stmesp_demux.c b/subsys/logging/frontends/log_frontend_stmesp_demux.c deleted file mode 100644 index ed09f89ec8e..00000000000 --- a/subsys/logging/frontends/log_frontend_stmesp_demux.c +++ /dev/null @@ -1,402 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include -LOG_MODULE_REGISTER(stmesp_demux); - -BUILD_ASSERT(sizeof(struct log_frontend_stmesp_demux_log_header) == sizeof(uint32_t), - "Must fit in a word"); - -#define NUM_OF_ACTIVE CONFIG_LOG_FRONTEND_STMESP_DEMUX_ACTIVE_PACKETS -#define M_ID_OFF 16 -#define M_ID_MASK (BIT_MASK(16) << M_ID_OFF) -#define C_ID_MASK BIT_MASK(16) - -#define M_CH_HW_EVENT 0x00800000 -#define M_CH_INVALID 0xFFFFFFFF - -struct log_frontend_stmesp_demux_active_entry { - sys_snode_t node; - uint32_t m_ch; - struct log_frontend_stmesp_demux_log *packet; - int off; -}; - -struct log_frontend_stmesp_demux { - /* Pool for active entries. */ - struct k_mem_slab mslab; - - /* List of currently active entries. */ - sys_slist_t active_entries; - - /* The most recently used entry. */ - struct log_frontend_stmesp_demux_active_entry *curr; - - struct mpsc_pbuf_buffer pbuf; - - uint32_t curr_m_ch; - - const uint16_t *m_ids; - - uint32_t m_ids_cnt; - - uint32_t dropped; -}; - -static uint32_t buffer[CONFIG_LOG_FRONTEND_STMESP_DEMUX_BUFFER_SIZE] - __aligned(Z_LOG_MSG_ALIGNMENT); - -static struct log_frontend_stmesp_demux demux; -static uint32_t slab_buf[NUM_OF_ACTIVE * sizeof(struct log_frontend_stmesp_demux_active_entry)]; -static bool skip; - -static void notify_drop(const struct mpsc_pbuf_buffer *buffer, - const union mpsc_pbuf_generic *packet) -{ - demux.dropped++; -} - -static uint32_t calc_wlen(uint32_t total_len) -{ - return DIV_ROUND_UP(ROUND_UP(total_len, Z_LOG_MSG_ALIGNMENT), sizeof(uint32_t)); -} - -static uint32_t get_wlen(const union mpsc_pbuf_generic *packet) -{ - union log_frontend_stmesp_demux_packet p = {.rgeneric = packet}; - uint32_t len; - - switch (p.generic_packet->type) { - case LOG_FRONTEND_STMESP_DEMUX_TYPE_TRACE_POINT: - len = sizeof(struct log_frontend_stmesp_demux_trace_point) / sizeof(uint32_t); - break; - case LOG_FRONTEND_STMESP_DEMUX_TYPE_HW_EVENT: - len = sizeof(struct log_frontend_stmesp_demux_hw_event) / sizeof(uint32_t); - break; - default: - len = calc_wlen(p.log->hdr.total_len + - offsetof(struct log_frontend_stmesp_demux_log, data)); - break; - } - - return len; -} - -int log_frontend_stmesp_demux_init(const struct log_frontend_stmesp_demux_config *config) -{ - int err; - static const struct mpsc_pbuf_buffer_config pbuf_config = { - .buf = buffer, - .size = ARRAY_SIZE(buffer), - .notify_drop = notify_drop, - .get_wlen = get_wlen, - .flags = MPSC_PBUF_MODE_OVERWRITE | - (IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP_DEMUX_MAX_UTILIZATION) ? - MPSC_PBUF_MAX_UTILIZATION : 0)}; - - memset(buffer, 0, sizeof(buffer)); - mpsc_pbuf_init(&demux.pbuf, &pbuf_config); - - sys_slist_init(&demux.active_entries); - - if (config->m_ids_cnt > BIT(3)) { - return -EINVAL; - } - - demux.m_ids = config->m_ids; - demux.m_ids_cnt = config->m_ids_cnt; - demux.dropped = 0; - demux.curr_m_ch = M_CH_INVALID; - demux.curr = NULL; - - err = k_mem_slab_init(&demux.mslab, slab_buf, - sizeof(struct log_frontend_stmesp_demux_active_entry), - NUM_OF_ACTIVE); - - return err; -} - -void log_frontend_stmesp_demux_major(uint16_t id) -{ - for (int i = 0; i < demux.m_ids_cnt; i++) { - if (id == demux.m_ids[i]) { - sys_snode_t *node; - - demux.curr_m_ch = id << M_ID_OFF; - demux.curr = NULL; - - SYS_SLIST_FOR_EACH_NODE(&demux.active_entries, node) { - struct log_frontend_stmesp_demux_active_entry *entry = - CONTAINER_OF(node, - struct log_frontend_stmesp_demux_active_entry, - node); - - if (entry->m_ch == demux.curr_m_ch) { - demux.curr = entry; - break; - } - } - skip = false; - return; - } - } - - skip = true; -} - -void log_frontend_stmesp_demux_channel(uint16_t id) -{ - if (skip) { - return; - } - - if (id == CONFIG_LOG_FRONTEND_STMESP_FLUSH_PORT_ID) { - /* Flushing data that shall be discarded. */ - goto bail; - } - - demux.curr_m_ch &= ~C_ID_MASK; - demux.curr_m_ch |= id; - - sys_snode_t *node; - - SYS_SLIST_FOR_EACH_NODE(&demux.active_entries, node) { - struct log_frontend_stmesp_demux_active_entry *entry = - CONTAINER_OF(node, struct log_frontend_stmesp_demux_active_entry, node); - - if (entry->m_ch == demux.curr_m_ch) { - demux.curr = entry; - return; - } - } - -bail: - demux.curr = NULL; -} - -static uint8_t get_major_id(uint16_t m_id) -{ - for (int i = 0; i < demux.m_ids_cnt; i++) { - if (m_id == demux.m_ids[i]) { - return i; - } - } - - __ASSERT_NO_MSG(0); - return 0; -} - -static void log_frontend_stmesp_demux_trace_point(uint16_t m_id, uint16_t id, uint64_t *ts, - uint32_t *data) -{ - struct log_frontend_stmesp_demux_trace_point packet = {.valid = 1, - .type = LOG_FRONTEND_STMESP_DEMUX_TYPE_TRACE_POINT, - .content_invalid = 0, - .has_data = data ? 1 : 0, - .timestamp = ts ? *ts : 0, - .major = m_id, - .id = id, - .data = data ? *data : 0}; - static const size_t wlen = sizeof(packet) / sizeof(uint32_t); - - mpsc_pbuf_put_data(&demux.pbuf, (const uint32_t *)&packet, wlen); -} - -static void log_frontend_stmesp_demux_hw_event(uint64_t *ts, uint8_t data) -{ - struct log_frontend_stmesp_demux_hw_event packet = {.valid = 1, - .type = LOG_FRONTEND_STMESP_DEMUX_TYPE_HW_EVENT, - .content_invalid = 0, - .timestamp = ts ? *ts : 0, - .evt = data}; - static const size_t wlen = sizeof(packet) / sizeof(uint32_t); - - mpsc_pbuf_put_data(&demux.pbuf, (const uint32_t *)&packet, wlen); -} - -int log_frontend_stmesp_demux_packet_start(uint32_t *data, uint64_t *ts) -{ - if (skip) { - return 0; - } - - struct log_frontend_stmesp_demux_active_entry *entry; - union log_frontend_stmesp_demux_packet p; - int err; - - if (demux.curr_m_ch == M_CH_INVALID) { - return -EINVAL; - } - - if (demux.curr_m_ch == M_CH_HW_EVENT) { - /* HW event */ - log_frontend_stmesp_demux_hw_event(ts, (uint8_t)*data); - - return 1; - } - - if (demux.curr != NULL) { - /* Previous package was incompleted. Finish it and potentially - * mark as incompleted if not all data is received. - */ - log_frontend_stmesp_demux_packet_end(); - return -EINVAL; - } - - uint16_t ch = demux.curr_m_ch & C_ID_MASK; - uint16_t m = get_major_id(demux.curr_m_ch >> M_ID_OFF); - - if (ch >= CONFIG_LOG_FRONTEND_STMESP_TP_CHAN_BASE) { - uint32_t id = (uint32_t)ch - CONFIG_LOG_FRONTEND_STMESP_TP_CHAN_BASE; - - /* Trace point */ - log_frontend_stmesp_demux_trace_point(m, id, ts, data); - - return 1; - } - - union log_frontend_stmesp_demux_header hdr = {.raw = *data}; - uint32_t pkt_len = hdr.log.total_len + offsetof(struct log_frontend_stmesp_demux_log, data); - uint32_t wlen = calc_wlen(pkt_len); - - err = k_mem_slab_alloc(&demux.mslab, (void **)&entry, K_NO_WAIT); - - if (err < 0) { - goto on_nomem; - } - - entry->m_ch = demux.curr_m_ch; - entry->off = 0; - p.generic = mpsc_pbuf_alloc(&demux.pbuf, wlen, K_NO_WAIT); - if (p.generic == NULL) { - k_mem_slab_free(&demux.mslab, entry); - goto on_nomem; - } - - entry->packet = p.log; - entry->packet->type = LOG_FRONTEND_STMESP_DEMUX_TYPE_LOG; - entry->packet->content_invalid = 0; - if (ts) { - entry->packet->timestamp = *ts; - } - entry->packet->hdr = hdr.log; - entry->packet->hdr.major = m; - demux.curr = entry; - sys_slist_append(&demux.active_entries, &entry->node); - - return 0; - -on_nomem: - demux.curr = NULL; - demux.dropped++; - return -ENOMEM; -} - -void log_frontend_stmesp_demux_timestamp(uint64_t ts) -{ - if (demux.curr == NULL) { - return; - } - - demux.curr->packet->timestamp = ts; -} - -void log_frontend_stmesp_demux_data(uint8_t *data, size_t len) -{ - if (demux.curr == NULL) { - return; - } - - if (demux.curr->off + len <= demux.curr->packet->hdr.total_len) { - memcpy(&demux.curr->packet->data[demux.curr->off], data, len); - demux.curr->off += len; - } -} - -void log_frontend_stmesp_demux_packet_end(void) -{ - if (demux.curr == NULL) { - return; - } - - union log_frontend_stmesp_demux_packet p = {.log = demux.curr->packet}; - - if (demux.curr->off != demux.curr->packet->hdr.total_len) { - demux.curr->packet->content_invalid = 1; - demux.dropped++; - } - - mpsc_pbuf_commit(&demux.pbuf, p.generic); - - sys_slist_find_and_remove(&demux.active_entries, &demux.curr->node); - k_mem_slab_free(&demux.mslab, demux.curr); - demux.curr = NULL; -} - -uint32_t log_frontend_stmesp_demux_get_dropped(void) -{ - uint32_t rv = demux.dropped; - - demux.dropped = 0; - - return rv; -} - -union log_frontend_stmesp_demux_packet log_frontend_stmesp_demux_claim(void) -{ - union log_frontend_stmesp_demux_packet p; - - /* Discard any invalid packets. */ - while ((p.rgeneric = mpsc_pbuf_claim(&demux.pbuf)) != NULL) { - if (p.generic_packet->content_invalid) { - mpsc_pbuf_free(&demux.pbuf, p.rgeneric); - } else { - break; - } - } - - return p; -} - -void log_frontend_stmesp_demux_free(union log_frontend_stmesp_demux_packet packet) -{ - mpsc_pbuf_free(&demux.pbuf, packet.rgeneric); -} - -void log_frontend_stmesp_demux_reset(void) -{ - sys_snode_t *node; - - while ((node = sys_slist_get(&demux.active_entries)) != NULL) { - struct log_frontend_stmesp_demux_active_entry *entry = - CONTAINER_OF(node, struct log_frontend_stmesp_demux_active_entry, node); - union log_frontend_stmesp_demux_packet p = {.log = entry->packet}; - - entry->packet->content_invalid = 1; - mpsc_pbuf_commit(&demux.pbuf, p.generic); - demux.dropped++; - demux.curr_m_ch = M_CH_INVALID; - - k_mem_slab_free(&demux.mslab, entry); - } -} - -bool log_frontend_stmesp_demux_is_idle(void) -{ - return sys_slist_is_empty(&demux.active_entries); -} - -int log_frontend_stmesp_demux_max_utilization(void) -{ - uint32_t max; - int rv = mpsc_pbuf_get_max_utilization(&demux.pbuf, &max); - - return rv == 0 ? max : rv; -} From cc6c8561a673837f1a8f5911e082e234fb4624fe Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 062/825] Revert "[nrf fromtree] samples: boards: nrf: Add sample using Coresight STM on nrf54h20" This reverts commit 477f844e743b89b3357517cd522807c44c1de1f0. --- .../boards/nrf/coresight_stm/CMakeLists.txt | 17 ---- .../boards/nrf/coresight_stm/Kconfig.sysbuild | 9 -- samples/boards/nrf/coresight_stm/prj.conf | 1 - .../nrf/coresight_stm/remote/CMakeLists.txt | 12 --- .../boards/nrf/coresight_stm/remote/prj.conf | 1 - samples/boards/nrf/coresight_stm/sample.yaml | 13 --- samples/boards/nrf/coresight_stm/src/main.c | 98 ------------------- .../boards/nrf/coresight_stm/sysbuild.cmake | 16 --- 8 files changed, 167 deletions(-) delete mode 100644 samples/boards/nrf/coresight_stm/CMakeLists.txt delete mode 100644 samples/boards/nrf/coresight_stm/Kconfig.sysbuild delete mode 100644 samples/boards/nrf/coresight_stm/prj.conf delete mode 100644 samples/boards/nrf/coresight_stm/remote/CMakeLists.txt delete mode 100644 samples/boards/nrf/coresight_stm/remote/prj.conf delete mode 100644 samples/boards/nrf/coresight_stm/sample.yaml delete mode 100644 samples/boards/nrf/coresight_stm/src/main.c delete mode 100644 samples/boards/nrf/coresight_stm/sysbuild.cmake diff --git a/samples/boards/nrf/coresight_stm/CMakeLists.txt b/samples/boards/nrf/coresight_stm/CMakeLists.txt deleted file mode 100644 index facbc05da92..00000000000 --- a/samples/boards/nrf/coresight_stm/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -cmake_minimum_required(VERSION 3.20.0) - -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) - -if(NOT (CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP)) - message(FATAL_ERROR "${BOARD}${BOARD_QUALIFIERS} is not supported for this sample") -endif() - -project(nrf_coresight_stm) - -target_sources(app PRIVATE src/main.c) diff --git a/samples/boards/nrf/coresight_stm/Kconfig.sysbuild b/samples/boards/nrf/coresight_stm/Kconfig.sysbuild deleted file mode 100644 index ae4c8048615..00000000000 --- a/samples/boards/nrf/coresight_stm/Kconfig.sysbuild +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 - -source "share/sysbuild/Kconfig" - -config RAD_CORE_BOARD -string - default "nrf54h20dk/nrf54h20/cpurad" if $(BOARD) = "nrf54h20dk" diff --git a/samples/boards/nrf/coresight_stm/prj.conf b/samples/boards/nrf/coresight_stm/prj.conf deleted file mode 100644 index 1bb8bf6d7fd..00000000000 --- a/samples/boards/nrf/coresight_stm/prj.conf +++ /dev/null @@ -1 +0,0 @@ -# empty diff --git a/samples/boards/nrf/coresight_stm/remote/CMakeLists.txt b/samples/boards/nrf/coresight_stm/remote/CMakeLists.txt deleted file mode 100644 index 93cb458f960..00000000000 --- a/samples/boards/nrf/coresight_stm/remote/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -cmake_minimum_required(VERSION 3.20.0) - -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(nrf_coresight_stm) - -target_sources(app PRIVATE ../src/main.c) diff --git a/samples/boards/nrf/coresight_stm/remote/prj.conf b/samples/boards/nrf/coresight_stm/remote/prj.conf deleted file mode 100644 index 1bb8bf6d7fd..00000000000 --- a/samples/boards/nrf/coresight_stm/remote/prj.conf +++ /dev/null @@ -1 +0,0 @@ -# empty diff --git a/samples/boards/nrf/coresight_stm/sample.yaml b/samples/boards/nrf/coresight_stm/sample.yaml deleted file mode 100644 index 07e17766279..00000000000 --- a/samples/boards/nrf/coresight_stm/sample.yaml +++ /dev/null @@ -1,13 +0,0 @@ -sample: - name: Logging using Coresight STM on nrf54h20 -common: - sysbuild: true -tests: - sample.boards.nrf.coresight_stm.dict: - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp - build_only: true - required_snippets: - - nordic-log-stm-dict diff --git a/samples/boards/nrf/coresight_stm/src/main.c b/samples/boards/nrf/coresight_stm/src/main.c deleted file mode 100644 index c203910b127..00000000000 --- a/samples/boards/nrf/coresight_stm/src/main.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -LOG_MODULE_REGISTER(app); - -#define TEST_LOG(rpt, item) \ - ({ \ - uint32_t t = k_cycle_get_32(); \ - for (uint32_t i = 0; i < rpt; i++) { \ - __DEBRACKET item; \ - } \ - t = k_cycle_get_32() - t; \ - k_msleep(200); \ - t; \ - }) - -static char *core_name = "unknown"; - -static void get_core_name(void) -{ - if (strstr(CONFIG_BOARD_TARGET, "cpuapp")) { - core_name = "app"; - } else if (strstr(CONFIG_BOARD_TARGET, "cpurad")) { - core_name = "rad"; - } else if (strstr(CONFIG_BOARD_TARGET, "cpuppr")) { - core_name = "ppr"; - } -} - -static uint32_t t_to_ns(uint32_t t, uint32_t rpt, uint32_t freq) -{ - return (uint32_t)(((uint64_t)t * 1000000000) / (uint64_t)(rpt * freq)); -} - -static void timing_report(uint32_t t, uint32_t rpt, const char *str) -{ - uint32_t ns = t_to_ns(t, rpt, CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC); - - printk("%s: Timing for %s: %d.%dus\n", core_name, str, ns / 1000, (ns % 1000) / 10); -} - -int main(void) -{ - uint32_t t; - uint32_t delta; - uint32_t rpt = 10; - uint32_t rpt_tp = 20; - uint32_t t0, t1, t2, t3, t_s, t_tp, t_tpd; - char str[] = "test string"; - - get_core_name(); - - t = k_cycle_get_32(); - delta = k_cycle_get_32() - t; - - t0 = TEST_LOG(rpt, (LOG_INF("test no arguments"))); - t0 -= delta; - - t1 = TEST_LOG(rpt, (LOG_INF("test with one argument %d", 100))); - t1 -= delta; - - t2 = TEST_LOG(rpt, (LOG_INF("test with two arguments %d %d", 100, 10))); - t2 -= delta; - - t3 = TEST_LOG(rpt, (LOG_INF("test with three arguments %d %d %d", 100, 10, 1))); - t3 -= delta; - - t_s = TEST_LOG(rpt, (LOG_INF("test with string %s", str))); - t_s -= delta; - - if (IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP)) { - t_tp = TEST_LOG(rpt_tp, (log_frontend_stmesp_tp(5))); - t_tp -= delta; - - t_tpd = TEST_LOG(rpt_tp, (log_frontend_stmesp_tp_d32(6, 10))); - t_tpd -= delta; - } - - timing_report(t0, rpt, "log message with 0 arguments"); - timing_report(t1, rpt, "log message with 1 argument"); - timing_report(t2, rpt, "log message with 2 arguments"); - timing_report(t3, rpt, "log message with 3 arguments"); - timing_report(t_s, rpt, "log_message with string"); - - if (IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP)) { - timing_report(t_tp, rpt_tp, "tracepoint"); - timing_report(t_tpd, rpt_tp, "tracepoint_d32"); - } - - return 0; -} diff --git a/samples/boards/nrf/coresight_stm/sysbuild.cmake b/samples/boards/nrf/coresight_stm/sysbuild.cmake deleted file mode 100644 index c2eaeeaa20f..00000000000 --- a/samples/boards/nrf/coresight_stm/sysbuild.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if("${SB_CONFIG_RAD_CORE_BOARD}" STREQUAL "") - message(FATAL_ERROR - "Target ${BOARD} not supported for this sample. " - "There is no remote board selected in Kconfig.sysbuild") -endif() - -set(RAD_APP remote) - -ExternalZephyrProject_Add( - APPLICATION ${RAD_APP} - SOURCE_DIR ${APP_DIR}/${RAD_APP} - BOARD ${SB_CONFIG_RAD_CORE_BOARD} -) From 4dc7809a2b4473de3550a6709617b780df6d75fd Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 063/825] Revert "[nrf fromtree] snippets: Add nordic-log-stm-dict snippet" This reverts commit 0015269df15d5def0beb89decbb12ae034403371. --- snippets/nordic-log-stm-dict/README.rst | 11 ----------- .../boards/nrf54h20_cpuapp.conf | 1 - .../boards/nrf54h20_cpuapp.overlay | 14 -------------- snippets/nordic-log-stm-dict/log_stm_dict.conf | 5 ----- snippets/nordic-log-stm-dict/snippet.yml | 8 -------- 5 files changed, 39 deletions(-) delete mode 100644 snippets/nordic-log-stm-dict/README.rst delete mode 100644 snippets/nordic-log-stm-dict/boards/nrf54h20_cpuapp.conf delete mode 100644 snippets/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay delete mode 100644 snippets/nordic-log-stm-dict/log_stm_dict.conf delete mode 100644 snippets/nordic-log-stm-dict/snippet.yml diff --git a/snippets/nordic-log-stm-dict/README.rst b/snippets/nordic-log-stm-dict/README.rst deleted file mode 100644 index a01536aefdc..00000000000 --- a/snippets/nordic-log-stm-dict/README.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. _nordic-log-stm-dict: - -Nordic Dictionary-based STM logging snippet (nordic-log-stm-dict) -################################################################# - -Overview -******** - -This snippet allows users to build Zephyr with the dictionary-based logging to -the Coresight STM stimulus ports. Data is collected in ETR buffer. Data from ETR -buffer is output on UART. diff --git a/snippets/nordic-log-stm-dict/boards/nrf54h20_cpuapp.conf b/snippets/nordic-log-stm-dict/boards/nrf54h20_cpuapp.conf deleted file mode 100644 index b4d9d63f77c..00000000000 --- a/snippets/nordic-log-stm-dict/boards/nrf54h20_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_UART_ASYNC_API=y diff --git a/snippets/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay b/snippets/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay deleted file mode 100644 index bedc93411c9..00000000000 --- a/snippets/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor - * SPDX-License-Identifier: Apache-2.0 - */ - -&tbm { - status = "okay"; -}; - -&tddconf { - status = "okay"; - stmsink = "etr"; - portconfig = <0>; -}; diff --git a/snippets/nordic-log-stm-dict/log_stm_dict.conf b/snippets/nordic-log-stm-dict/log_stm_dict.conf deleted file mode 100644 index 7384e36b92a..00000000000 --- a/snippets/nordic-log-stm-dict/log_stm_dict.conf +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_LOG=y -CONFIG_TEST_LOGGING_DEFAULTS=n -CONFIG_LOG_FRONTEND=y -CONFIG_LOG_FRONTEND_ONLY=y -CONFIG_LOG_FRONTEND_STMESP=y diff --git a/snippets/nordic-log-stm-dict/snippet.yml b/snippets/nordic-log-stm-dict/snippet.yml deleted file mode 100644 index 5bacbaf5af0..00000000000 --- a/snippets/nordic-log-stm-dict/snippet.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: nordic-log-stm-dict -append: - EXTRA_CONF_FILE: log_stm_dict.conf -boards: - /.*/nrf54h20/cpuapp/: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpuapp.overlay - EXTRA_CONF_FILE: boards/nrf54h20_cpuapp.conf From 51e7087af2ca8c43a74807772a9058c52386a8e9 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 064/825] Revert "[nrf fromtree] drivers: misc: coresight: Add nrf_etr module" This reverts commit 184262c53d234cd21b1da2b6a44b92b97a8ad727. --- drivers/misc/Kconfig | 1 - drivers/misc/coresight/CMakeLists.txt | 4 - drivers/misc/coresight/Kconfig | 45 ----- drivers/misc/coresight/nrf_etr.c | 241 -------------------------- 4 files changed, 291 deletions(-) delete mode 100644 drivers/misc/coresight/CMakeLists.txt delete mode 100644 drivers/misc/coresight/Kconfig delete mode 100644 drivers/misc/coresight/nrf_etr.c diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 1202a360ae1..a87218c120a 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -13,6 +13,5 @@ source "drivers/misc/timeaware_gpio/Kconfig" source "drivers/misc/devmux/Kconfig" source "drivers/misc/nordic_vpr_launcher/Kconfig" source "drivers/misc/mcux_flexio/Kconfig" -source "drivers/misc/coresight/Kconfig" endmenu diff --git a/drivers/misc/coresight/CMakeLists.txt b/drivers/misc/coresight/CMakeLists.txt deleted file mode 100644 index 1ec34ca2f75..00000000000 --- a/drivers/misc/coresight/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -zephyr_library_sources_ifdef(CONFIG_NRF_ETR nrf_etr.c) diff --git a/drivers/misc/coresight/Kconfig b/drivers/misc/coresight/Kconfig deleted file mode 100644 index 0e670845de7..00000000000 --- a/drivers/misc/coresight/Kconfig +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -DT_COMPAT_NORDIC_NRF_TBM := nordic,nrf-tbm - -config NRF_ETR - bool "Coresight ETR handler (with Nordic TBM)" - depends on $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_TBM)) - select NRFX_TBM - default y - help - Module handles data stored in the ETR circular buffer (e.g. STM logging - data). Busyness is tracked using TBM (Trace Buffer Monitor) peripheral - which is specific to Nordic Semiconductor SoCs. - -if NRF_ETR - -config NRF_ETR_STACK_SIZE - int "ETR thread stack size" - default 1024 - -config NRF_ETR_BACKOFF - int "Thread backoff time (ms)" - default 10 - help - Determines how often attempt to dump the data is performed. - -config NRF_ETR_FLUSH_TIMEOUT - int "Backoff time during flushing (ms)" - default 100 - help - When thread triggers flushing of ETR data, it periodically checks if - there is still a pending ETR data. This option specifies how often - thread is waking up to check. Given in milliseconds. - -config NRF_ETR_SYNC_PERIOD - int "Period of custom synchronization frame" - default 16 - help - To help find the synchronization when decoding the ETR content - by a host tool a synchronization pattern (16 bytes of 0xFF) can be - sent on regular intervals. This frame is sent between Coresight formatter - frames. Use 0 to disable. - -endif # NRF_ETR diff --git a/drivers/misc/coresight/nrf_etr.c b/drivers/misc/coresight/nrf_etr.c deleted file mode 100644 index fbd0ea08936..00000000000 --- a/drivers/misc/coresight/nrf_etr.c +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -LOG_MODULE_REGISTER(cs_etr_tbm); - -#define UART_NODE DT_CHOSEN(zephyr_console) - -#define ETR_BUFFER_NODE DT_NODELABEL(etr_buffer) - -#define CORESIGHT_TRACE_FRAME_SIZE32 4 -#define FRAME_SIZE8 (CORESIGHT_TRACE_FRAME_SIZE32 * sizeof(uint32_t)) - -#define MIN_DATA CORESIGHT_TRACE_FRAME_SIZE32 - -#define MEMORY_SECTION(node) \ - COND_CODE_1(DT_NODE_HAS_PROP(node, memory_regions), \ - (__attribute__((__section__( \ - LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(node, memory_regions)))))), \ - ()) - -static const uint32_t wsize_mask = DT_REG_SIZE(ETR_BUFFER_NODE) / sizeof(int) - 1; -static const uint32_t wsize_inc = DT_REG_SIZE(ETR_BUFFER_NODE) / sizeof(int) - 1; - -static volatile bool tbm_full; -static volatile uint32_t base_wr_idx; -static uint32_t etr_rd_idx; -static bool volatile use_async_uart; - -static struct k_sem uart_sem; -static const struct device *uart_dev = DEVICE_DT_GET(UART_NODE); -static uint32_t frame_buf0[CORESIGHT_TRACE_FRAME_SIZE32] MEMORY_SECTION(UART_NODE); -static uint32_t frame_buf1[CORESIGHT_TRACE_FRAME_SIZE32] MEMORY_SECTION(UART_NODE); -static uint32_t *frame_buf = frame_buf0; - -K_KERNEL_STACK_DEFINE(etr_stack, CONFIG_NRF_ETR_STACK_SIZE); -static struct k_thread etr_thread; - -BUILD_ASSERT((DT_REG_SIZE(ETR_BUFFER_NODE) % CONFIG_DCACHE_LINE_SIZE) == 0); -BUILD_ASSERT((DT_REG_ADDR(ETR_BUFFER_NODE) % CONFIG_DCACHE_LINE_SIZE) == 0); - -/** @brief Get write index. - * - * It is a non-wrapping 32 bit write index. To get actual index in the ETR buffer - * result must be masked by ETR buffer size mask. - */ -static uint32_t get_wr_idx(void) -{ - uint32_t cnt = nrfx_tbm_count_get(); - - if (tbm_full && (cnt < wsize_mask)) { - /* TBM full event is generated when max value is reached and not when - * overflow occurs. We cannot increment base_wr_idx just after the - * event but only when counter actually wraps. - */ - base_wr_idx += wsize_inc; - tbm_full = false; - } - - return cnt + base_wr_idx; -} - -/** @brief Get amount of pending data in ETR buffer. */ -static uint32_t pending_data(void) -{ - return get_wr_idx() - etr_rd_idx; -} - -/** @brief Get current read index. - * - * Read index is not exact index in the ETR buffer. It does not wrap (32 bit word). - * So ETR read index is derived by masking the value by the ETR buffer size mask. - */ -static void rd_idx_inc(void) -{ - etr_rd_idx += CORESIGHT_TRACE_FRAME_SIZE32; -} - -/** @brief Attempt to process data pending in the ETR circular buffer. - * - * Data is processed in 16 bytes packages. Each package is a STPv2 frame which - * contain data generated by STM stimulus ports. - * - */ -static void process(void) -{ - static const uint32_t *const etr_buf = (uint32_t *)(DT_REG_ADDR(ETR_BUFFER_NODE)); - static uint32_t sync_cnt; - int err; - uint32_t pending; - - /* If function is called in panic mode then it may interrupt ongoing - * processing. This must be carefully handled as function decodes data - * that must be synchronized. Losing synchronization results in failure. - * - * Special measures are taken to ensure proper synchronization when - * processing is preempted by panic. - * - */ - while ((pending = pending_data()) >= MIN_DATA) { - /* Do not read the data that has already been read but not yet processed. */ - if (sync_cnt || (CONFIG_NRF_ETR_SYNC_PERIOD == 0)) { - sync_cnt--; - sys_cache_data_invd_range((void *)&etr_buf[etr_rd_idx & wsize_mask], - FRAME_SIZE8); - for (int i = 0; i < CORESIGHT_TRACE_FRAME_SIZE32; i++) { - frame_buf[i] = etr_buf[(etr_rd_idx + i) & wsize_mask]; - } - rd_idx_inc(); - __sync_synchronize(); - } else { - sync_cnt = CONFIG_NRF_ETR_SYNC_PERIOD; - memset(frame_buf, 0xff, FRAME_SIZE8); - } - - if (use_async_uart) { - err = k_sem_take(&uart_sem, K_FOREVER); - __ASSERT_NO_MSG(err >= 0); - - err = uart_tx(uart_dev, (uint8_t *)frame_buf, FRAME_SIZE8, SYS_FOREVER_US); - __ASSERT_NO_MSG(err >= 0); - /* Switch buffers to prevent overwriting data which is being sent. */ - frame_buf = (frame_buf == frame_buf0) ? frame_buf1 : frame_buf0; - } else { - for (int i = 0; i < FRAME_SIZE8; i++) { - uart_poll_out(uart_dev, ((uint8_t *)frame_buf)[i]); - } - } - } - - /* Fill the buffer to ensure that all logs are processed on time. */ - if (pending < MIN_DATA) { - log_frontend_stmesp_dummy_write(); - } -} - -int etr_dump_flush(bool blocking) -{ - if (blocking) { - int cnt = 4; - /* Set flag which forces uart to use blocking polling out instead of - * asynchronous API. - */ - use_async_uart = false; - uint32_t k = irq_lock(); - - /* Repeat arbitrary number of times to ensure that all that is flushed. */ - while (cnt--) { - process(); - } - - irq_unlock(k); - - return 0; - } - - if (!k_is_preempt_thread()) { - return -ENOTSUP; - } - - /* Due to writing dummy data there is always some data pending so use arbitrary - * value to decide that majority of data is flushed. - */ - while (pending_data() >= 2 * MIN_DATA) { - k_msleep(CONFIG_NRF_ETR_FLUSH_TIMEOUT); - } - - return 0; -} - -static void etr_thread_func(void *dummy1, void *dummy2, void *dummy3) -{ - while (1) { - process(); - k_sleep(K_MSEC(CONFIG_NRF_ETR_BACKOFF)); - } -} - -static void uart_event_handler(const struct device *dev, struct uart_event *evt, void *user_data) -{ - ARG_UNUSED(dev); - - switch (evt->type) { - case UART_TX_ABORTED: - /* An intentional fall-through to UART_TX_DONE. */ - case UART_TX_DONE: - k_sem_give(&uart_sem); - break; - default: - __ASSERT_NO_MSG(0); - } -} - -static void tbm_event_handler(nrf_tbm_event_t event) -{ - ARG_UNUSED(event); - - if (event == NRF_TBM_EVENT_FULL) { - tbm_full = true; - } - - k_wakeup(&etr_thread); -} - -int etr_process_init(void) -{ - int err; - - k_sem_init(&uart_sem, 1, 1); - - err = uart_callback_set(uart_dev, uart_event_handler, NULL); - use_async_uart = (err == 0); - - static const nrfx_tbm_config_t config = {.size = wsize_mask}; - - nrfx_tbm_init(&config, tbm_event_handler); - - IRQ_CONNECT(DT_IRQN(DT_NODELABEL(tbm)), DT_IRQ(DT_NODELABEL(tbm), priority), - nrfx_isr, nrfx_tbm_irq_handler, 0); - irq_enable(DT_IRQN(DT_NODELABEL(tbm))); - - k_thread_create(&etr_thread, etr_stack, K_KERNEL_STACK_SIZEOF(etr_stack), - etr_thread_func, NULL, NULL, NULL, K_LOWEST_APPLICATION_THREAD_PRIO, 0, - K_NO_WAIT); - k_thread_name_set(&etr_thread, "etr_process"); - - return 0; -} - -SYS_INIT(etr_process_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); From d6858d9a47a8d472eccfb08b4a5fe0d80e0066d6 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 065/825] Revert "[nrf fromtree] boards: nordic: nrf54h20dk: Add ETR buffer to the memory map" This reverts commit d9d4dda6eaaaf2f431d7e7197acc11b92a8de7fc. --- boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi index 0d79ea5b556..26a1e6fac74 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi @@ -52,6 +52,7 @@ }; etr_buf_ram0x_region: memory@2f0be000 { + /* TODO to be reworked when SDFW with STM support is released.*/ compatible = "nordic,owned-memory"; reg = <0x2f0be000 DT_SIZE_K(4)>; status = "disabled"; @@ -62,7 +63,6 @@ #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)>; }; From 6a2689ce6e1f5030fbe1b84fb880ba23a485b7e3 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 066/825] Revert "[nrf fromtree] dts: Add nordic,nrf-tddconf node" This reverts commit 3b8ca3d812049fedb8a6b56ab2a44f98d56757e3. --- dts/bindings/arm/nordic,nrf-tddconf.yaml | 28 ------------------------ dts/common/nordic/nrf54h20.dtsi | 6 ----- 2 files changed, 34 deletions(-) delete mode 100644 dts/bindings/arm/nordic,nrf-tddconf.yaml diff --git a/dts/bindings/arm/nordic,nrf-tddconf.yaml b/dts/bindings/arm/nordic,nrf-tddconf.yaml deleted file mode 100644 index 8ef56b44c58..00000000000 --- a/dts/bindings/arm/nordic,nrf-tddconf.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - Nordic TRACE and Debug Domain - - Configuration for the Trace and Debug subsystem - -compatible: "nordic,nrf-tddconf" - -include: base.yaml - -properties: - stmsink: - type: string - description: indicates the sink for STM data - enum: - - "etr" - - "tpiu" - # - "etb" - Not supported yet - portconfig: - type: int - description: TPIU clock divider - TDD HSFLL / 2^(2 + portconfig) - enum: - - 0 - - 1 - - 2 - - 3 diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index bbbb2c03d96..7d49696af07 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -408,12 +408,6 @@ status = "disabled"; interrupts = <127 NRF_DEFAULT_IRQ_PRIORITY>; }; - - tddconf: tddconf@1000 { - compatible = "nordic,nrf-tddconf"; - reg = <0x1000 0x10>; - status = "disabled"; - }; }; global_peripherals: peripheral@5f000000 { From c1ac3048f6b5e68315597098f31374b7f31417f2 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 067/825] Revert "[nrf fromtree] soc: nordic: nrf54h: Add STM data flushing in pre_sleep" This reverts commit 6ea76cf636b166ac52f7f839c5264434d7838287. --- soc/nordic/nrf54h/soc.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 9c27e7b2199..7aa6985a05c 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -10,10 +10,6 @@ #include #include -#ifdef CONFIG_LOG_FRONTEND_STMESP -#include -#endif - #include #include #include @@ -115,17 +111,6 @@ static int trim_hsfll(void) return 0; } -#if defined(CONFIG_ARM_ON_ENTER_CPU_IDLE_HOOK) -bool z_arm_on_enter_cpu_idle(void) -{ -#ifdef CONFIG_LOG_FRONTEND_STMESP - log_frontend_stmesp_pre_sleep(); -#endif - - return true; -} -#endif - static int nordicsemi_nrf54h_init(void) { sys_cache_instr_enable(); From 1802938461aca14e89937097a1c8695c0325548b Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 068/825] Revert "[nrf fromtree] logging: Add Coresight STMESP dictionary-based frontend" This reverts commit 464318d918ef11f415297b33b8d60b78291c4b97. --- include/zephyr/logging/log_frontend_stmesp.h | 91 ---- subsys/logging/frontends/CMakeLists.txt | 5 - subsys/logging/frontends/Kconfig | 49 -- .../logging/frontends/log_frontend_stmesp.c | 487 ------------------ 4 files changed, 632 deletions(-) delete mode 100644 include/zephyr/logging/log_frontend_stmesp.h delete mode 100644 subsys/logging/frontends/log_frontend_stmesp.c diff --git a/include/zephyr/logging/log_frontend_stmesp.h b/include/zephyr/logging/log_frontend_stmesp.h deleted file mode 100644 index ac9fae69578..00000000000 --- a/include/zephyr/logging/log_frontend_stmesp.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ -#ifndef ZEPHYR_INCLUDE_LOGGING_LOG_FRONTEND_STMESP_H_ -#define ZEPHYR_INCLUDE_LOGGING_LOG_FRONTEND_STMESP_H_ - -#include -#include -#ifdef CONFIG_LOG_FRONTEND_STMESP -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** @brief Notify frontend that ETR/STM is ready. - * - * Log frontend optionally dumps buffered data and start to write to the STM - * stimulus port. - * - * @note Function is applicable only for the domain that performs initial ETR/STM setup. - * - * @retval 0 on success. - * @retval -EIO if there was an internal failure. - */ -int log_frontend_stmesp_etr_ready(void); - -/** @brief Hook to be called before going to sleep. - * - * Hook writes dummy data to the STM Stimulus Port to ensure that all logging - * data is flushed. - */ -void log_frontend_stmesp_pre_sleep(void); - -/** @brief Perform a dummy write to STMESP. - * - * It can be used to force flushing STM data. - */ -void log_frontend_stmesp_dummy_write(void); - -/** @brief Trace point - * - * Write a trace point information using STM. Number of unique trace points is limited - * to 65536 - CONFIG_LOG_FRONTEND_STMESP_TP_CHAN_BASE per core. - * - * @param x Trace point ID. - */ -static inline void log_frontend_stmesp_tp(uint16_t x) -{ -#ifdef CONFIG_LOG_FRONTEND_STMESP - STMESP_Type *port; - int err = stmesp_get_port((uint32_t)x + CONFIG_LOG_FRONTEND_STMESP_TP_CHAN_BASE, &port); - - __ASSERT_NO_MSG(err == 0); - if (err == 0) { - stmesp_flag(port, 1, true, - IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP_GUARANTEED_ACCESS)); - } -#endif -} - -/** @brief Trace point with 32 bit data. - * - * Write a trace point information using STM. Number of unique trace points is limited - * to 65536 - CONFIG_LOG_FRONTEND_STMESP_TP_CHAN_BASE per core. - * - * @param x Trace point ID. - * @param d Data. 32 bit word. - */ -static inline void log_frontend_stmesp_tp_d32(uint16_t x, uint32_t d) -{ -#ifdef CONFIG_LOG_FRONTEND_STMESP - STMESP_Type *port; - int err = stmesp_get_port((uint32_t)x + CONFIG_LOG_FRONTEND_STMESP_TP_CHAN_BASE, &port); - - __ASSERT_NO_MSG(err == 0); - if (err == 0) { - stmesp_data32(port, d, true, true, - IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP_GUARANTEED_ACCESS)); - } -#endif -} - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_INCLUDE_LOGGING_LOG_FRONTEND_STMESP_H_ */ diff --git a/subsys/logging/frontends/CMakeLists.txt b/subsys/logging/frontends/CMakeLists.txt index a6f97605f7c..4e2d82bc6dd 100644 --- a/subsys/logging/frontends/CMakeLists.txt +++ b/subsys/logging/frontends/CMakeLists.txt @@ -4,8 +4,3 @@ zephyr_sources_ifdef( CONFIG_LOG_FRONTEND_DICT_UART log_frontend_dict_uart.c ) - -zephyr_sources_ifdef( - CONFIG_LOG_FRONTEND_STMESP - log_frontend_stmesp.c -) diff --git a/subsys/logging/frontends/Kconfig b/subsys/logging/frontends/Kconfig index dd8d12c2ad8..7a725421fb9 100644 --- a/subsys/logging/frontends/Kconfig +++ b/subsys/logging/frontends/Kconfig @@ -29,53 +29,4 @@ config LOG_FRONTEND_DICT_UART_DROPPED_NOTIFY_PERIOD in milliseconds. endif - -config LOG_FRONTEND_STMESP - bool "Coresight STM frontend" - imply ARM_ON_ENTER_CPU_IDLE_HOOK if LOG_FRONTEND_STMESP_FLUSH_COUNT > 0 - -if LOG_FRONTEND_STMESP - -config LOG_FRONTEND_STMESP_DICT - bool - default y - select LOG_FRONTEND_OPT_API - select LOG_DICTIONARY_DB - imply LOG_FMT_SECTION - imply LOG_FMT_SECTION_STRIP - -config LOG_FRONTEND_STMESP_FLUSH_COUNT - int "Number of flushing words" - default 4 - help - Before going to sleep CPU shall write to STM some dummy data to ensure - that any buffered data goes to TPIU/ETR. - -config LOG_FRONTEND_STMESP_FLUSH_PORT_ID - def_int 0 - -config LOG_FRONTEND_STMESP_EARLY_BUF_SIZE - int "Buffer size to store early messages" - default 0 - help - Frontend cannot write to STM if it is used with ETR buffer unless ETR is - initialized and memory is properly configured (privileges). Data is stored - in the buffer and flushed to the STMESP once the pipeline is ready. - -config LOG_FRONTEND_STMESP_DICT_VER - def_int 0 - -config LOG_FRONTEND_STMESP_GUARANTEED_ACCESS - bool "Use STMESP guaranteed access" - help - When enabled, accessing STMESP registers will stall if write cannot be - performed (e.g. ETR buffer is full). - -config LOG_FRONTEND_STMESP_TP_CHAN_BASE - def_int 255 - help - Do not change this value as it is aligned with host decoder (nrfutil trace). - -endif # LOG_FRONTEND_STMESP - endmenu diff --git a/subsys/logging/frontends/log_frontend_stmesp.c b/subsys/logging/frontends/log_frontend_stmesp.c deleted file mode 100644 index d50e1c8320d..00000000000 --- a/subsys/logging/frontends/log_frontend_stmesp.c +++ /dev/null @@ -1,487 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include -#include -#include -#include -#include -#include -#include - -/* Only 32 bit platforms supported. */ -BUILD_ASSERT(sizeof(void *) == sizeof(uint32_t)); - -#define LOG_FRONTEND_STM_NO_SOURCE 0xFFFF - -#define EARLY_BUF_SIZE CONFIG_LOG_FRONTEND_STMESP_EARLY_BUF_SIZE - -#define LEN_SZ sizeof(uint32_t) - -#define STMESP_FLUSH_WORD 0xaabbccdd - -#define STM_FLAG(reg) \ - stmesp_flag(reg, 1, false, IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP_GUARANTEED_ACCESS)) - -#define STM_D8(reg, data, timestamp, marked) \ - stmesp_data8(reg, data, timestamp, marked, \ - IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP_GUARANTEED_ACCESS)) - -#define STM_D32(reg, data, timestamp, marked) \ - stmesp_data32(reg, data, timestamp, marked, \ - IS_ENABLED(CONFIG_LOG_FRONTEND_STMESP_GUARANTEED_ACCESS)) - -/* Buffer for storing frontend data before STM/ETR is ready for usage. - * When notification about ETR readiness is received content of this buffer is - * written to the STM stimulus port. - */ -static atomic_t stmesp_chan_cnt; - -static uint8_t early_buf[EARLY_BUF_SIZE] __aligned(sizeof(uint32_t)); -static uint32_t early_buf_idx; -static struct k_spinlock lock; - -/* Flag indicating that STM/ETR is ready for use. */ -static bool etr_rdy; - -/* Number of messages dropped due to too small early buffer. */ -static uint32_t dropped; - -/* Flag indicating that logging is in the panic mode. */ -static bool in_panic; - -static atomic_t new_data; - -/* Enum used for type bit field in the message. */ -enum stm_msg_type_log_dict { - /* Dictionary-based log message */ - STM_MSG_TYPE_LOG_DICT = 0, - /* Reserved for future use. */ - STM_MSG_TYPE_RESERVED = 1, -}; - -/* Descriptor of the dictionary based logging message. */ -struct stm_log_dict_msg_desc { - /* Structure version. Current version 0. */ - uint32_t ver: 2; - - /* Type. Set 0 as this is a logging message descriptor. */ - uint32_t type: 1; - - /* Severity level. */ - uint32_t level: 3; - - /* Data length, non-zero fox hexdump message. */ - uint32_t data_len: 12; - - /* Source ID. Source index as ordered in the memory section. */ - uint32_t source_id: 12; - - /* Reserved for future use. */ - uint32_t reserved: 2; -}; - -union stm_log_dict_hdr { - struct stm_log_dict_msg_desc hdr; - uint32_t raw; -}; - -/* Dictionary header initializer. */ -#define DICT_HDR_INITIALIZER(_level, _source_id, _data_len) \ - { \ - .hdr = {.ver = CONFIG_LOG_FRONTEND_STMESP_DICT_VER, \ - .type = STM_MSG_TYPE_LOG_DICT, \ - .level = _level, \ - .data_len = _data_len, \ - .source_id = _source_id, \ - .reserved = 0 } \ - } - -/* Align early buffer index to a 32 bit word. */ -static inline void early_buf_align_idx(void) -{ - uint32_t rem = early_buf_idx & 0x3; - - if (rem) { - early_buf_idx += (sizeof(uint32_t) - rem); - } -} - -/* Get address where length is written. Location is used in the dictionary mode - * where length of the message is only known once whole message is written. - * Calculated length is written to the length field location. - */ -static inline uint32_t *early_buf_len_loc(void) -{ - early_buf_align_idx(); - - uint32_t *loc = (uint32_t *)&early_buf[early_buf_idx]; - - early_buf_idx += LEN_SZ; - - return loc; -} - -/* Check if there is space for requested amount of data. */ -static inline bool early_buf_has_space(uint32_t len) -{ - return (EARLY_BUF_SIZE - early_buf_idx) >= len; -} - -/* Calculate length of the message. It is calculated by taking current write - * location and length location (which is at the beginning of the current message. - * Used in dictionary mode. - */ -static inline uint32_t early_buf_get_len(uint32_t *len_loc) -{ - if (early_buf_idx == EARLY_BUF_SIZE) { - return 0; - } - - return (uint32_t)((uintptr_t)&early_buf[early_buf_idx] - (uintptr_t)len_loc - LEN_SZ); -} - -/* Check if there is available space for the message. If yes, write length field - * and return true. If allocation fails it sets next length field to 0 to indicate - * that the buffer is full. - */ -static inline bool early_buf_alloc(uint32_t len) -{ - early_buf_align_idx(); - - if (early_buf_has_space(len + LEN_SZ)) { - *(uint32_t *)&early_buf[early_buf_idx] = len; - early_buf_idx += LEN_SZ; - return true; - } - - if (early_buf_has_space(LEN_SZ)) { - *(uint32_t *)&early_buf[early_buf_idx] = 0; - } - - return false; -} - -/* Switch to read mode. Start reading from the beginning. */ -static inline void early_buf_read_mode(void) -{ - early_buf_idx = 0; -} - -/* Get message. Returns 0 if no messages. */ -static inline uint32_t early_buf_get_data(void **buf) -{ - early_buf_align_idx(); - - if (early_buf_has_space(LEN_SZ)) { - uint32_t len = *(uint32_t *)&early_buf[early_buf_idx]; - - *buf = &early_buf[early_buf_idx + LEN_SZ]; - early_buf_idx += len + LEN_SZ; - return len; - } - - return 0; -} - -static int early_package_cb(const void *buf, size_t len, void *ctx) -{ - ARG_UNUSED(ctx); - - if (early_buf_has_space(len)) { - memcpy(&early_buf[early_buf_idx], buf, len); - early_buf_idx += len; - } else { - early_buf_idx = EARLY_BUF_SIZE; - } - - return 0; -} - -static inline void write_data(const void *data, size_t len, STMESP_Type *const stm_esp) -{ - uint32_t *p32 = (uint32_t *)data; - - while (len >= sizeof(uint32_t)) { - STM_D32(stm_esp, *p32++, false, false); - len -= sizeof(uint32_t); - } - - uint8_t *p8 = (uint8_t *)p32; - - while (len > 0) { - STM_D8(stm_esp, *p8++, false, false); - len--; - } -} - -static int package_cb(const void *buf, size_t len, void *ctx) -{ - write_data(buf, len, (STMESP_Type *const)ctx); - - return len; -} - -/* Get STM channel to use. Ensure that channel is unique for given priority level. - * This way we know that writing to that channel will not be interrupted by - * another log message writing to the same channel. - */ -static inline uint16_t get_channel(void) -{ - return (atomic_inc(&stmesp_chan_cnt) & 0x7F) + 1; -} - -/* Convert pointer to the source structure to the source ID. */ -static inline int16_t get_source_id(const void *source) -{ - if (source != NULL) { - return IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) - ? log_dynamic_source_id((void *)source) - : log_const_source_id(source); - } - - return LOG_FRONTEND_STM_NO_SOURCE; -} - -static void packet_end(STMESP_Type *stm_esp) -{ - STM_FLAG(stm_esp); - atomic_set(&new_data, 1); -} - -/* Common function to end the message when STMESP is not ready. */ -static inline void early_msg_end(uint32_t *len_loc) -{ - *len_loc = early_buf_get_len(len_loc); - if (*len_loc == 0) { - dropped++; - } -} - -void log_frontend_msg(const void *source, const struct log_msg_desc desc, uint8_t *package, - const void *data) -{ - static const uint32_t flags = CBPRINTF_PACKAGE_CONVERT_RW_STR; - union stm_log_dict_hdr dict_desc = - DICT_HDR_INITIALIZER(desc.level, get_source_id(source), 0); - - if ((EARLY_BUF_SIZE == 0) || etr_rdy) { - STMESP_Type *stm_esp; - int err; - - err = stmesp_get_port(get_channel(), &stm_esp); - if (err < 0) { - return; - } - - STM_D32(stm_esp, dict_desc.raw, true, true); - (void)cbprintf_package_convert(package, desc.package_len, package_cb, - stm_esp, flags, NULL, 0); - if (data) { - package_cb(data, desc.data_len, stm_esp); - } - packet_end(stm_esp); - } else { - k_spinlock_key_t key; - uint32_t *len_loc; - - key = k_spin_lock(&lock); - len_loc = early_buf_len_loc(); - early_package_cb(&dict_desc.raw, sizeof(dict_desc.raw), NULL); - (void)cbprintf_package_convert(package, desc.package_len, early_package_cb, - NULL, flags, NULL, 0); - if (data) { - early_package_cb(data, desc.data_len, NULL); - } - early_msg_end(len_loc); - k_spin_unlock(&lock, key); - } -} - -/* Common function for optimized message (log with 0-2 arguments) which is used in - * case when STMESP is not yet ready. - */ -static inline uint32_t *early_msg_start(uint32_t level, const void *source, - uint32_t package_hdr, const char *fmt) -{ - union stm_log_dict_hdr dict_desc = DICT_HDR_INITIALIZER(level, get_source_id(source), 0); - uint32_t fmt32 = (uint32_t)fmt; - uint32_t *len_loc = early_buf_len_loc(); - - early_package_cb(&dict_desc.raw, sizeof(dict_desc.raw), NULL); - early_package_cb(&package_hdr, sizeof(package_hdr), NULL); - early_package_cb(&fmt32, sizeof(fmt32), NULL); - - return len_loc; -} - -/* Common function for optimized message (log with 0-2 arguments) which writes to STMESP */ -static inline void msg_start(STMESP_Type *stm_esp, uint32_t level, - const void *source, uint32_t package_hdr, const char *fmt) - -{ - union stm_log_dict_hdr dict_desc = DICT_HDR_INITIALIZER(level, get_source_id(source), 0); - - STM_D32(stm_esp, dict_desc.raw, true, true); - STM_D32(stm_esp, package_hdr, false, false); - STM_D32(stm_esp, (uint32_t)fmt, false, false); -} - -void log_frontend_simple_0(const void *source, uint32_t level, const char *fmt) -{ - static const union cbprintf_package_hdr package_hdr = {.desc = {.len = 2}}; - - if ((EARLY_BUF_SIZE == 0) || etr_rdy) { - STMESP_Type *stm_esp; - int err; - - err = stmesp_get_port(get_channel(), &stm_esp); - if (err < 0) { - return; - } - - msg_start(stm_esp, level, source, (uint32_t)package_hdr.raw, fmt); - packet_end(stm_esp); - return; - } - - uint32_t *len_loc; - k_spinlock_key_t key; - - key = k_spin_lock(&lock); - len_loc = early_msg_start(level, source, (uint32_t)package_hdr.raw, fmt); - early_msg_end(len_loc); - k_spin_unlock(&lock, key); -} - -void log_frontend_simple_1(const void *source, uint32_t level, const char *fmt, uint32_t arg) -{ - static const union cbprintf_package_hdr package_hdr = {.desc = {.len = 2 + 1}}; - - if ((EARLY_BUF_SIZE == 0) || etr_rdy) { - STMESP_Type *stm_esp; - int err; - - err = stmesp_get_port(get_channel(), &stm_esp); - if (err < 0) { - return; - } - - msg_start(stm_esp, level, source, (uint32_t)package_hdr.raw, fmt); - STM_D32(stm_esp, arg, false, false); - packet_end(stm_esp); - return; - } - - uint32_t *len_loc; - k_spinlock_key_t key; - - key = k_spin_lock(&lock); - len_loc = early_msg_start(level, source, (uint32_t)package_hdr.raw, fmt); - early_package_cb(&arg, sizeof(arg), NULL); - early_msg_end(len_loc); - k_spin_unlock(&lock, key); -} - -void log_frontend_simple_2(const void *source, uint32_t level, const char *fmt, uint32_t arg0, - uint32_t arg1) -{ - static const union cbprintf_package_hdr package_hdr = {.desc = {.len = 2 + 2}}; - - if ((EARLY_BUF_SIZE == 0) || etr_rdy) { - STMESP_Type *stm_esp; - int err; - - err = stmesp_get_port(get_channel(), &stm_esp); - if (err < 0) { - return; - } - - msg_start(stm_esp, level, source, (uint32_t)package_hdr.raw, fmt); - STM_D32(stm_esp, arg0, false, false); - STM_D32(stm_esp, arg1, false, false); - packet_end(stm_esp); - return; - } - - uint32_t *len_loc; - k_spinlock_key_t key; - - key = k_spin_lock(&lock); - len_loc = early_msg_start(level, source, (uint32_t)package_hdr.raw, fmt); - early_package_cb(&arg0, sizeof(arg0), NULL); - early_package_cb(&arg1, sizeof(arg1), NULL); - early_msg_end(len_loc); - k_spin_unlock(&lock, key); -} - -void log_frontend_panic(void) -{ - in_panic = true; -} - -void log_frontend_init(void) -{ - /* empty */ -} - -void log_frontend_stmesp_dummy_write(void) -{ -#define STMESP_DUMMY_WORD 0xaabbccdd - - STMESP_Type *stm_esp; - - (void)stmesp_get_port(CONFIG_LOG_FRONTEND_STMESP_FLUSH_PORT_ID, &stm_esp); - STM_D32(stm_esp, STMESP_DUMMY_WORD, false, false); -} - -void log_frontend_stmesp_pre_sleep(void) -{ - bool use_stm = etr_rdy || (EARLY_BUF_SIZE == 0); - - if (!use_stm || new_data == 0) { - return; - } - - for (uint32_t i = 0; i < CONFIG_LOG_FRONTEND_STMESP_FLUSH_COUNT; i++) { - log_frontend_stmesp_dummy_write(); - } - - atomic_set(&new_data, 0); -} - -#if EARLY_BUF_SIZE > 0 -int log_frontend_stmesp_etr_ready(void) -{ - STMESP_Type *stm_esp; - uint16_t len; - uint32_t *buf = NULL; - int err; - - err = stmesp_get_port(get_channel(), &stm_esp); - if (err < 0) { - return -EIO; - } - - early_buf_read_mode(); - - while ((len = early_buf_get_data((void **)&buf)) > 0) { - /* Write first word with Marked and timestamp. */ - STM_D32(stm_esp, *buf, true, true); - buf++; - len -= sizeof(uint32_t); - - /* Write remaining data as raw data. */ - write_data(buf, len, stm_esp); - - /* Flag the end. */ - packet_end(stm_esp); - } - - etr_rdy = true; - - return 0; -} -#endif /* EARLY_BUF_SIZE > 0 */ From f723b042b6a4cffd9ac98a095691d6b3b7a125dc Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 069/825] Revert "[nrf fromtree] drivers: misc: Add support for coresight STMESP" This reverts commit 3184ae89e5b88f6ab35a3bbc5d29971a434daf8e. --- .../zephyr/drivers/misc/coresight/stmesp.h | 193 ------------------ 1 file changed, 193 deletions(-) delete mode 100644 include/zephyr/drivers/misc/coresight/stmesp.h diff --git a/include/zephyr/drivers/misc/coresight/stmesp.h b/include/zephyr/drivers/misc/coresight/stmesp.h deleted file mode 100644 index d14e6e42c69..00000000000 --- a/include/zephyr/drivers/misc/coresight/stmesp.h +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_DRIVERS_MISC_CORESIGHT_STMESP_H_ -#define ZEPHYR_INCLUDE_DRIVERS_MISC_CORESIGHT_STMESP_H_ - -#include - -/** - * @brief Coresight STMESP (STM Extended Stimulus Port) Interface - * @defgroup stmsp_interface Coresight STMESP interface - * @ingroup misc_interfaces - * @{ - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** @cond INTERNAL_HIDDEN - * @brief STMESP register structure. - */ -typedef struct { - volatile uint32_t G_DMTS[2]; - volatile uint32_t G_DM[2]; - volatile uint32_t G_DTS[2]; - volatile uint32_t G_D[2]; - volatile uint32_t RESERVED0[16]; - volatile uint32_t G_FLAGTS[2]; - volatile uint32_t G_FLAG[2]; - volatile uint32_t G_TRIGTS[2]; - volatile uint32_t G_TRIG[2]; - volatile uint32_t I_DMTS[2]; - volatile uint32_t I_DM[2]; - volatile uint32_t I_DTS[2]; - volatile uint32_t I_D[2]; - volatile uint32_t RESERVED1[16]; - volatile uint32_t I_FLAGTS[2]; - volatile uint32_t I_FLAG[2]; - volatile uint32_t I_TRIGTS[2]; - volatile uint32_t I_TRIG[2]; -} STMESP_Type; - -/** @brief Helper function for getting target register. - * - * @param reg STMESP register set. - * @param ts Use timestamp. - * @param marked Use marked register. - * @param guaranteed True to use guaranteed access. - * - * @return Address of the register. - */ -static inline volatile void *_stmesp_get_data_reg(STMESP_Type *reg, bool ts, - bool marked, bool guaranteed) -{ - if (ts) { - if (guaranteed) { - if (marked) { - return ®->G_DMTS[0]; - } else { - return ®->G_DTS[0]; - } - } else { - if (marked) { - return ®->I_DMTS[0]; - } else { - return ®->I_DTS[0]; - } - } - } else { - if (guaranteed) { - if (marked) { - return ®->G_DM[0]; - } else { - return ®->G_D[0]; - } - } else { - if (marked) { - return ®->I_DM[0]; - } else { - return ®->I_D[0]; - } - } - } -} - -/** @endcond */ - -/** @brief Write flag to STMESP - * - * @param reg STMESP register set. - * @param data Data written to the flag register. - * @param ts If true add timestamp. - * @param guaranteed If true guaranteed write and invariant if false. - */ -static inline void stmesp_flag(STMESP_Type *reg, uint32_t data, bool ts, bool guaranteed) -{ - if (ts) { - if (guaranteed) { - reg->G_FLAGTS[0] = data; - } else { - reg->I_FLAGTS[0] = data; - } - } else { - if (guaranteed) { - reg->G_FLAG[0] = data; - } else { - reg->I_FLAG[0] = data; - } - } -} - -/** @brief Write 8 bit data to STMESP - * - * @param reg STMESP register set. - * @param data Byte to write. - * @param ts If true add timestamp. - * @param marked If true marked write. - * @param guaranteed If true guaranteed write and invariant if false. - */ -static inline void stmesp_data8(STMESP_Type *reg, uint8_t data, bool ts, - bool marked, bool guaranteed) -{ - *(volatile uint8_t *)_stmesp_get_data_reg(reg, ts, marked, guaranteed) = data; -} - -/** @brief Write 16 bit data to STMESP - * - * @param reg STMESP register set. - * @param data Half word to write. - * @param ts If true add timestamp. - * @param marked If true marked write. - * @param guaranteed If true guaranteed write and invariant if false. - */ -static inline void stmesp_data16(STMESP_Type *reg, uint16_t data, bool ts, - bool marked, bool guaranteed) -{ - *(volatile uint16_t *)_stmesp_get_data_reg(reg, ts, marked, guaranteed) = data; -} - -/** @brief Write 32 bit data to STMESP - * - * @param reg STMESP register set. - * @param data Word to write. - * @param ts If true add timestamp. - * @param marked If true marked write. - * @param guaranteed If true guaranteed write and invariant if false. - */ -static inline void stmesp_data32(STMESP_Type *reg, uint32_t data, bool ts, - bool marked, bool guaranteed) -{ - *(volatile uint32_t *)_stmesp_get_data_reg(reg, ts, marked, guaranteed) = data; -} - -/** - * @brief Return address of a STM extended stimulus port. - * - * Function return a port from the local STMESP instance. - * - * @param[in] idx Index of the requested stimulus port. - * @param[out] port Location where pointer to the port is written. - * - * @retval -EINVAL if @p idx or @p port is invalid. - * @retval 0 on success. - */ -static inline int stmesp_get_port(uint32_t idx, STMESP_Type **port) - -{ - /* Check if index is within STM ports */ - if ((port == NULL) || - (idx >= (DT_REG_SIZE(DT_NODELABEL(stmesp)) / sizeof(STMESP_Type)))) { - return -EINVAL; - } - - STMESP_Type *const base = (STMESP_Type *const)DT_REG_ADDR(DT_NODELABEL(stmesp)); - - *port = &base[idx]; - - return 0; -} - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* ZEPHYR_INCLUDE_DRIVERS_MISC_CORESIGHT_STMESP_H_ */ From 3f206c3c441658006731d68e9810bb91686c79dc Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:52 +0200 Subject: [PATCH 070/825] Revert "[nrf fromtree] dts: nordic: nrf54h20: Add stmesp nodes" This reverts commit 4b0804f0d0539ea239e014ea401b0fdf993670f2. --- dts/arm/nordic/nrf54h20_cpuapp.dtsi | 5 ----- dts/arm/nordic/nrf54h20_cpurad.dtsi | 5 ----- dts/riscv/nordic/nrf54h20_cpuppr.dtsi | 5 ----- 3 files changed, 15 deletions(-) diff --git a/dts/arm/nordic/nrf54h20_cpuapp.dtsi b/dts/arm/nordic/nrf54h20_cpuapp.dtsi index d6577a548f3..895ca8ea20b 100644 --- a/dts/arm/nordic/nrf54h20_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54h20_cpuapp.dtsi @@ -25,11 +25,6 @@ wdt011: &cpuapp_wdt011 {}; compatible = "simple-bus"; interrupt-parent = <&cpuapp_nvic>; ranges; - - stmesp: memory@a2000000 { - compatible = "arm,stmesp"; - reg = <0xa2000000 0x1000000>; - }; }; }; diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index 9f6f579faeb..4a69438f83c 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -29,11 +29,6 @@ wdt011: &cpurad_wdt011 {}; compatible = "simple-bus"; interrupt-parent = <&cpurad_nvic>; ranges; - - stmesp: memory@a3000000 { - compatible = "arm,stmesp"; - reg = <0xa3000000 0x1000000>; - }; }; }; diff --git a/dts/riscv/nordic/nrf54h20_cpuppr.dtsi b/dts/riscv/nordic/nrf54h20_cpuppr.dtsi index bb43fd96243..057b45f3560 100644 --- a/dts/riscv/nordic/nrf54h20_cpuppr.dtsi +++ b/dts/riscv/nordic/nrf54h20_cpuppr.dtsi @@ -25,11 +25,6 @@ cpusys_vevif: &cpusys_vevif_tx {}; compatible = "simple-bus"; interrupt-parent = <&cpuppr_clic>; ranges; - - stmesp: memory@ae000000 { - compatible = "arm,stmesp"; - reg = <0xae000000 0x1000000>; - }; }; }; From 46d0333aea4221851b9f1c07918eb6484878e0f2 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 071/825] Revert "[nrf fromtree] dts: bindings: debug: Add binding for ARM STMESP" This reverts commit e1edfcc71ba206ade51b569f9f4dd394ae7d578d. --- dts/bindings/debug/arm,stmesp.yaml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 dts/bindings/debug/arm,stmesp.yaml diff --git a/dts/bindings/debug/arm,stmesp.yaml b/dts/bindings/debug/arm,stmesp.yaml deleted file mode 100644 index 14bcd7e94e2..00000000000 --- a/dts/bindings/debug/arm,stmesp.yaml +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Common fields for ARM instrumentation System Trace Macrocell Extended Stimulus Port (STMESP) - -include: base.yaml From 5fc6c246721773fa410d0da7cd8af0f45c7a4146 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 072/825] Revert "[nrf fromtree] logging: Move frontends to the dedicated directory" This reverts commit 0b6e7f23cdfdce1a67e09db734d32b59997991c5. --- subsys/logging/CMakeLists.txt | 6 +++++- subsys/logging/Kconfig | 2 +- subsys/logging/{frontends/Kconfig => Kconfig.frontends} | 0 subsys/logging/frontends/CMakeLists.txt | 6 ------ subsys/logging/{frontends => }/log_frontend_dict_uart.c | 0 5 files changed, 6 insertions(+), 8 deletions(-) rename subsys/logging/{frontends/Kconfig => Kconfig.frontends} (100%) delete mode 100644 subsys/logging/frontends/CMakeLists.txt rename subsys/logging/{frontends => }/log_frontend_dict_uart.c (100%) diff --git a/subsys/logging/CMakeLists.txt b/subsys/logging/CMakeLists.txt index 2d5bf6638d5..e1cd8e7d5f5 100644 --- a/subsys/logging/CMakeLists.txt +++ b/subsys/logging/CMakeLists.txt @@ -43,13 +43,17 @@ if(NOT CONFIG_LOG_MODE_MINIMAL) log_cmds.c ) + zephyr_sources_ifdef( + CONFIG_LOG_FRONTEND_DICT_UART + log_frontend_dict_uart.c + ) + zephyr_sources_ifdef( CONFIG_LOG_DICTIONARY_SUPPORT log_output_dict.c ) add_subdirectory(backends) - add_subdirectory(frontends) # For some reason, running sys-t with catalog message on # Cortex-M0 would result in hard fault in mipi_catalog_formatter() diff --git a/subsys/logging/Kconfig b/subsys/logging/Kconfig index f7a7b32b804..57e447f85a0 100644 --- a/subsys/logging/Kconfig +++ b/subsys/logging/Kconfig @@ -37,7 +37,7 @@ endif # !LOG_MODE_MINIMAL if LOG_FRONTEND -rsource "frontends/Kconfig" +rsource "Kconfig.frontends" endif #LOG_FRONTEND diff --git a/subsys/logging/frontends/Kconfig b/subsys/logging/Kconfig.frontends similarity index 100% rename from subsys/logging/frontends/Kconfig rename to subsys/logging/Kconfig.frontends diff --git a/subsys/logging/frontends/CMakeLists.txt b/subsys/logging/frontends/CMakeLists.txt deleted file mode 100644 index 4e2d82bc6dd..00000000000 --- a/subsys/logging/frontends/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -zephyr_sources_ifdef( - CONFIG_LOG_FRONTEND_DICT_UART - log_frontend_dict_uart.c -) diff --git a/subsys/logging/frontends/log_frontend_dict_uart.c b/subsys/logging/log_frontend_dict_uart.c similarity index 100% rename from subsys/logging/frontends/log_frontend_dict_uart.c rename to subsys/logging/log_frontend_dict_uart.c From fd95192cf6422076238bed9127d5e1224769ded8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 073/825] Revert "[nrf fromtree] debug: mipi_stp_decoder: Align naming to 2.4 standard" This reverts commit 575b8dbb71a43a51c88387e3dfeff76cc771a633. --- include/zephyr/debug/mipi_stp_decoder.h | 6 +++--- subsys/debug/mipi_stp_decoder.c | 8 ++++---- tests/subsys/debug/mipi_stp_decoder/src/main.c | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/zephyr/debug/mipi_stp_decoder.h b/include/zephyr/debug/mipi_stp_decoder.h index c5ec3a81891..85b08af6419 100644 --- a/include/zephyr/debug/mipi_stp_decoder.h +++ b/include/zephyr/debug/mipi_stp_decoder.h @@ -27,7 +27,7 @@ enum mipi_stp_decoder_ctrl_type { STP_DATA32 = 8, STP_DATA64 = 16, STP_DECODER_NULL = 128, - STP_DECODER_MAJOR, + STP_DECODER_MASTER, STP_DECODER_MERROR, STP_DECODER_CHANNEL, STP_DECODER_VERSION, @@ -50,7 +50,7 @@ enum mipi_stp_decoder_ctrl_type { _type == STP_DATA32 ? "DATA32" : (\ _type == STP_DATA64 ? "DATA64" : (\ _type == STP_DECODER_NULL ? "NULL" : (\ - _type == STP_DECODER_MAJOR ? "MAJOR" : (\ + _type == STP_DECODER_MASTER ? "MASTER" : (\ _type == STP_DECODER_MERROR ? "MERROR" : (\ _type == STP_DECODER_CHANNEL ? "CHANNEL" : (\ _type == STP_DECODER_VERSION ? "VERSION" : (\ @@ -62,7 +62,7 @@ enum mipi_stp_decoder_ctrl_type { /** @brief Union with data associated with a given STP opcode. */ union mipi_stp_decoder_data { - /** ID - used for major and channel. */ + /** ID - used for master and channel. */ uint16_t id; /** Frequency. */ diff --git a/subsys/debug/mipi_stp_decoder.c b/subsys/debug/mipi_stp_decoder.c index ccca67e219a..39aacbdd4d7 100644 --- a/subsys/debug/mipi_stp_decoder.c +++ b/subsys/debug/mipi_stp_decoder.c @@ -255,7 +255,7 @@ static void data64_mts_cb(uint64_t data, uint64_t ts) cfg.cb(STP_DATA64, d, &ts, true); } -static void major_cb(uint64_t id, uint64_t ts) +static void master_cb(uint64_t id, uint64_t ts) { ARG_UNUSED(ts); uint16_t m_id = (uint16_t)id; @@ -263,7 +263,7 @@ static void major_cb(uint64_t id, uint64_t ts) curr_ch = 0; - cfg.cb(STP_DECODER_MAJOR, data, NULL, false); + cfg.cb(STP_DECODER_MASTER, data, NULL, false); } static void channel16_cb(uint64_t id, uint64_t ts) @@ -381,7 +381,7 @@ static void async_cb(uint64_t data, uint64_t ts) static const struct stp_item items[] = { STP_ITEM(STP_NULL, (0x0), 1, 0, false, null_cb), - STP_ITEM(STP_M8, (0x1), 1, 2, false, major_cb), + STP_ITEM(STP_M8, (0x1), 1, 2, false, master_cb), STP_ITEM(STP_MERR, (0x2), 1, 2, false, merror_cb), STP_ITEM(STP_C8, (0x3), 1, 2, false, channel_cb), STP_ITEM(STP_D8, (0x4), 1, 2, false, data8_cb), @@ -410,7 +410,7 @@ static const struct stp_item items[] = { STP_ITEM(STP_FREQ_40, (0xf0, 0xf0), 4, 10, false, freq_cb), STP_ITEM(STP_FREQ_40_TS, (0xf0, 0xf1), 4, 0, true, notsup_cb), STP_ITEM(STP_DIP, (0xf0, 0xf2), 4, 0, false, notsup_cb), - STP_ITEM(STP_M16, (0xf1), 2, 4, false, major_cb), + STP_ITEM(STP_M16, (0xf1), 2, 4, false, master_cb), STP_ITEM(STP_GERR, (0xf2), 2, 2, false, gerror_cb), STP_ITEM(STP_C16, (0xf3), 2, 4, false, channel16_cb), STP_ITEM(STP_D8TS, (0xf4), 2, 2, true, data8_ts_cb), diff --git a/tests/subsys/debug/mipi_stp_decoder/src/main.c b/tests/subsys/debug/mipi_stp_decoder/src/main.c index cfefe93bcec..ecf519de4aa 100644 --- a/tests/subsys/debug/mipi_stp_decoder/src/main.c +++ b/tests/subsys/debug/mipi_stp_decoder/src/main.c @@ -59,14 +59,14 @@ ZTEST(mipi_stp_decoder_test, test_chunk_null) zassert_equal(cnt, d_cnt, NULL); } -ZTEST(mipi_stp_decoder_test, test_chunk_major) +ZTEST(mipi_stp_decoder_test, test_chunk_master) { /* 0x1(m8) 0xab 0x0 (null) 0xf1(m16) 0x3412 */ uint8_t data[] = {0xa1, 0x0b, 0x1f, 0x34, 0x12}; - ADD_ITEM(cnt, STP_DECODER_MAJOR, UINT64_MAX, false, (uint8_t)0xab); + ADD_ITEM(cnt, STP_DECODER_MASTER, UINT64_MAX, false, (uint8_t)0xab); ADD_ITEM(cnt, STP_DECODER_NULL, UINT64_MAX, false, (uint8_t)0); - ADD_ITEM(cnt, STP_DECODER_MAJOR, UINT64_MAX, false, (uint16_t)0x4321); + ADD_ITEM(cnt, STP_DECODER_MASTER, UINT64_MAX, false, (uint16_t)0x4321); mipi_stp_decoder_decode(data, sizeof(data)); zassert_equal(cnt, d_cnt, NULL); @@ -78,12 +78,12 @@ ZTEST(mipi_stp_decoder_test, test_chunk_channel) uint8_t data[] = {0x10, 0xba, 0xa3, 0xfb, 0x63, 0x44, 0x36, 0xbb, 0x01, 0x3b, 0xaa}; ADD_ITEM(cnt, STP_DECODER_NULL, UINT64_MAX, false, (uint8_t)0); - ADD_ITEM(cnt, STP_DECODER_MAJOR, UINT64_MAX, false, (uint8_t)0xab); + ADD_ITEM(cnt, STP_DECODER_MASTER, UINT64_MAX, false, (uint8_t)0xab); ADD_ITEM(cnt, STP_DECODER_CHANNEL, UINT64_MAX, false, (uint8_t)0xab); ADD_ITEM(cnt, STP_DECODER_CHANNEL, UINT64_MAX, false, (uint16_t)0x6446); /* MSB byte is taken from previous C16 */ ADD_ITEM(cnt, STP_DECODER_CHANNEL, UINT64_MAX, false, (uint16_t)0x64bb); - ADD_ITEM(cnt, STP_DECODER_MAJOR, UINT64_MAX, false, (uint8_t)0x0b); + ADD_ITEM(cnt, STP_DECODER_MASTER, UINT64_MAX, false, (uint8_t)0x0b); /* M8 resets current channel */ ADD_ITEM(cnt, STP_DECODER_CHANNEL, UINT64_MAX, false, (uint8_t)0xaa); From 11ed420a2ddb502b0ba37434914be623422d350b Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 074/825] Revert "[nrf fromtree] doc: services: debugging: Add CS Trace Deformatter doc" This reverts commit f26685ec9ffa25141b28f83eed9b296e889cd8e6. --- doc/services/debugging/cs_trace_defmt.rst | 23 ----------------------- doc/services/debugging/index.rst | 1 - 2 files changed, 24 deletions(-) delete mode 100644 doc/services/debugging/cs_trace_defmt.rst diff --git a/doc/services/debugging/cs_trace_defmt.rst b/doc/services/debugging/cs_trace_defmt.rst deleted file mode 100644 index 7bade40c9f7..00000000000 --- a/doc/services/debugging/cs_trace_defmt.rst +++ /dev/null @@ -1,23 +0,0 @@ -.. _cs_trace_defmt: - -ARM Coresight Trace Deformatter -############################### - -Formatter is a method of wrapping multiple trace streams (specified by 7 bit ID) into a -single output stream. Formatter is using 16 byte frames which wraps up to 15 bytes of -data. It is used, for example, by ETR (Embedded Trace Router) which is a circular RAM -buffer where data from various trace streams can be saved. Typically tracing data is -decoded offline by the host but deformatter can be used on-chip to decode the data during -application runtime. - -Usage -##### - -Deformatter is initialized with a user callback. Data is decoded using -:c:func:`cs_trace_defmt_process` in 16 bytes chunks. Callback is called whenever stream changes or -end of chunk is reached. Callback contains stream ID and the data. - -API documentation -***************** - -.. doxygengroup:: cs_trace_defmt diff --git a/doc/services/debugging/index.rst b/doc/services/debugging/index.rst index 0ff8fe1d528..259fd894ac4 100644 --- a/doc/services/debugging/index.rst +++ b/doc/services/debugging/index.rst @@ -11,4 +11,3 @@ Debugging gdbstub.rst debugmon.rst mipi_stp_decoder.rst - cs_trace_defmt.rst From 34ad9c126a731cdb650f863d1586d59c8cff8cd2 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 075/825] Revert "[nrf fromtree] tests: debug: Add test for Coresight Trace Deformatter" This reverts commit 32a712a09712410ba5e20099dd58f3012c57298a. --- .../debug/cs_trace_defmt/CMakeLists.txt | 8 -- tests/subsys/debug/cs_trace_defmt/README | 1 - tests/subsys/debug/cs_trace_defmt/prj.conf | 2 - tests/subsys/debug/cs_trace_defmt/src/main.c | 99 ------------------- .../subsys/debug/cs_trace_defmt/testcase.yaml | 5 - 5 files changed, 115 deletions(-) delete mode 100644 tests/subsys/debug/cs_trace_defmt/CMakeLists.txt delete mode 100644 tests/subsys/debug/cs_trace_defmt/README delete mode 100644 tests/subsys/debug/cs_trace_defmt/prj.conf delete mode 100644 tests/subsys/debug/cs_trace_defmt/src/main.c delete mode 100644 tests/subsys/debug/cs_trace_defmt/testcase.yaml diff --git a/tests/subsys/debug/cs_trace_defmt/CMakeLists.txt b/tests/subsys/debug/cs_trace_defmt/CMakeLists.txt deleted file mode 100644 index b6ccff2f616..00000000000 --- a/tests/subsys/debug/cs_trace_defmt/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(cs_trace_defmt) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/tests/subsys/debug/cs_trace_defmt/README b/tests/subsys/debug/cs_trace_defmt/README deleted file mode 100644 index d58994d4751..00000000000 --- a/tests/subsys/debug/cs_trace_defmt/README +++ /dev/null @@ -1 +0,0 @@ -Test for decoder of frames encoded using Coresight Trace Formatter. diff --git a/tests/subsys/debug/cs_trace_defmt/prj.conf b/tests/subsys/debug/cs_trace_defmt/prj.conf deleted file mode 100644 index 00dfeb8085e..00000000000 --- a/tests/subsys/debug/cs_trace_defmt/prj.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_ZTEST=y -CONFIG_CS_TRACE_DEFMT=y diff --git a/tests/subsys/debug/cs_trace_defmt/src/main.c b/tests/subsys/debug/cs_trace_defmt/src/main.c deleted file mode 100644 index f97e8893f06..00000000000 --- a/tests/subsys/debug/cs_trace_defmt/src/main.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA. - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include -#include - -static const uint8_t *exp_data[3]; -static size_t exp_len[3]; -static uint8_t exp_id[3]; -static uint8_t cb_cnt; - -static void callback(uint32_t id, const uint8_t *data, size_t len) -{ - zassert_equal(exp_id[cb_cnt], id, NULL); - zassert_equal(len, exp_len[cb_cnt], NULL); - zassert_equal(memcmp(data, exp_data[cb_cnt], len), 0, NULL); - cb_cnt++; -} - -ZTEST(coresight_trace_deformatter_test, test_err_check) -{ - int err; - uint8_t data[16]; - - err = cs_trace_defmt_init(callback); - zassert_equal(err, 0); - - err = cs_trace_defmt_process(data, 15); - zassert_equal(err, -EINVAL); - - err = cs_trace_defmt_process(data, 17); - zassert_equal(err, -EINVAL); -} - -ZTEST(coresight_trace_deformatter_test, test_basic) -{ - int err; - static const uint8_t id = 0x25; - static const uint8_t data1[] = {/* First byte has ID, byte 2 has LSB bit set */ - (id << 1) | 1, - 0x6, - 0x0 /*LSB bit in aux */, - 0xe, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0x2}; - - static const uint8_t exp_data1[] = {0x6, 0x1, 0xe, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - - cb_cnt = 0; - exp_id[0] = id; - exp_data[0] = exp_data1; - exp_len[0] = 14; - - cs_trace_defmt_init(callback); - err = cs_trace_defmt_process(data1, 16); - zassert_equal(err, 0); - zassert_equal(cb_cnt, 1); -} - -ZTEST(coresight_trace_deformatter_test, test_basic2) -{ - int err; - static const uint8_t data1[] = {0x07, 0xAA, 0xA6, 0xA7, 0x2B, 0xA8, 0x54, 0x52, - 0x52, 0x54, 0x07, 0xCA, 0xC6, 0xC7, 0xC8, 0x1C}; - - static const uint8_t exp_data1[] = {0xAA, 0xA6, 0xA7, 0xA8}; - static const uint8_t exp_data2[] = {0x55, 0x52, 0x53, 0x54}; - static const uint8_t exp_data3[] = {0xCA, 0xC6, 0xC7, 0xC8}; - - cb_cnt = 0; - exp_id[0] = 0x3; - exp_data[0] = exp_data1; - exp_len[0] = sizeof(exp_data1); - exp_id[1] = 0x15; - exp_data[1] = exp_data2; - exp_len[1] = sizeof(exp_data2); - exp_id[2] = 0x3; - exp_data[2] = exp_data3; - exp_len[2] = sizeof(exp_data3); - - cs_trace_defmt_init(callback); - err = cs_trace_defmt_process(data1, 16); - zassert_equal(err, 0); - zassert_equal(cb_cnt, 3); -} - -ZTEST_SUITE(coresight_trace_deformatter_test, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/subsys/debug/cs_trace_defmt/testcase.yaml b/tests/subsys/debug/cs_trace_defmt/testcase.yaml deleted file mode 100644 index d4eb8db1d59..00000000000 --- a/tests/subsys/debug/cs_trace_defmt/testcase.yaml +++ /dev/null @@ -1,5 +0,0 @@ -tests: - debug.cs_trace_defmt: - tags: debug - integration_platforms: - - native_posix From 63ccda88d9f183f292879f2fa06bd5ee4c264b00 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 076/825] Revert "[nrf fromtree] debug: coresight: Add coresight_trace_deformatter" This reverts commit 94f8bfb337ccde7cdf40fd7c11d36f0d793103d6. --- .../zephyr/debug/coresight/cs_trace_defmt.h | 64 ------------------- subsys/debug/CMakeLists.txt | 5 -- subsys/debug/Kconfig | 6 -- subsys/debug/coresight/cs_trace_defmt.c | 63 ------------------ 4 files changed, 138 deletions(-) delete mode 100644 include/zephyr/debug/coresight/cs_trace_defmt.h delete mode 100644 subsys/debug/coresight/cs_trace_defmt.c diff --git a/include/zephyr/debug/coresight/cs_trace_defmt.h b/include/zephyr/debug/coresight/cs_trace_defmt.h deleted file mode 100644 index b9920672681..00000000000 --- a/include/zephyr/debug/coresight/cs_trace_defmt.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_DEBUG_CORESIGHT_CS_TRACE_DEFMT_H__ -#define ZEPHYR_INCLUDE_DEBUG_CORESIGHT_CS_TRACE_DEFMT_H__ - -#include -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup coresight_apis Coresight APIs - * @{ - * @} - * @defgroup cs_trace_defmt Coresight Trace Deformatter - * @ingroup coresight_apis - * @{ - */ - -/** @brief Callback signature. - * - * @param id Stream ID. - * @param data Data. - * @param len Data length. - */ -typedef void (*cs_trace_defmt_cb)(uint32_t id, const uint8_t *data, size_t len); - -/** @brief Size of trace deformatter frame size in 32 bit words. */ -#define CORESIGHT_TRACE_FRAME_SIZE32 4 - -/** @brief Size of trace deformatter frame size in bytes. */ -#define CORESIGHT_TRACE_FRAME_SIZE (CORESIGHT_TRACE_FRAME_SIZE32 * sizeof(uint32_t)) - -/** @brief Initialize Coresight Trace Deformatter. - * - * @param cb Callback. - */ -int cs_trace_defmt_init(cs_trace_defmt_cb cb); - -/** @brief Decode data from the stream. - * - * Trace formatter puts data in the 16 byte long blocks. - * - * Callback is called with decoded data. - * - * @param data Data. - * @param len Data length. Must equal 16. - * - * @retval 0 On successful deformatting. - * @retval -EINVAL If wrong length is provided. - */ -int cs_trace_defmt_process(const uint8_t *data, size_t len); - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_INCLUDE_DEBUG_CORESIGHT_CS_TRACE_DEFMT_H__ */ diff --git a/subsys/debug/CMakeLists.txt b/subsys/debug/CMakeLists.txt index 7618a952861..d9cbc68b975 100644 --- a/subsys/debug/CMakeLists.txt +++ b/subsys/debug/CMakeLists.txt @@ -34,8 +34,3 @@ zephyr_sources_ifdef( CONFIG_MIPI_STP_DECODER mipi_stp_decoder.c ) - -zephyr_sources_ifdef( - CONFIG_CS_TRACE_DEFMT - coresight/cs_trace_defmt.c -) diff --git a/subsys/debug/Kconfig b/subsys/debug/Kconfig index a1603ae02e9..5fd5d9bfd5d 100644 --- a/subsys/debug/Kconfig +++ b/subsys/debug/Kconfig @@ -450,9 +450,3 @@ config MIPI_STP_DECODER depends on !BIG_ENDIAN help Module decodes a stream of STPv2 data. - -config CS_TRACE_DEFMT - bool "Coresight Trace Deformatter" - help - Module is decoding data which is formatted using Coresight - Trace Formatter, e.g. when data is put into ETR (Embedded Trace Router). diff --git a/subsys/debug/coresight/cs_trace_defmt.c b/subsys/debug/coresight/cs_trace_defmt.c deleted file mode 100644 index adae8320799..00000000000 --- a/subsys/debug/coresight/cs_trace_defmt.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA. - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include - -static cs_trace_defmt_cb callback; -static uint8_t curr_id; - -int cs_trace_defmt_init(cs_trace_defmt_cb cb) -{ - callback = cb; - return 0; -} - -int cs_trace_defmt_process(const uint8_t *data, size_t len) -{ - uint8_t buf[15]; - size_t cnt = 0; - - if (len != 16) { - return -EINVAL; - } - - uint8_t aux = data[15]; - uint8_t d_id; - uint8_t cb_id; - bool do_cb = false; - - for (int i = 0; i < 8; i++) { - d_id = data[2 * i]; - if (d_id & 0x1) { - if (cnt != 0) { - cb_id = curr_id; - if ((aux >> i) & 0x1) { - /* next byte belongs to the old stream */ - do_cb = true; - } else { - callback(cb_id, buf, cnt); - cnt = 0; - } - } - curr_id = d_id >> 1; - } else { - buf[cnt++] = d_id | ((aux >> i) & 0x1); - } - if (i < 7) { - buf[cnt++] = data[2 * i + 1]; - if (do_cb) { - do_cb = false; - callback(cb_id, buf, cnt); - cnt = 0; - } - } - } - - if (cnt) { - callback(curr_id, buf, cnt); - } - - return 0; -} From 0e5d884e7ed25c0d7e491640e7113257c4890c54 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 077/825] Revert "[nrf fromtree] dts: nordic: nrf54h20: add nordic,clockpin-enable settings" This reverts commit d6c1e938e844f1eaba30319f4c434b2e4f7768b5. --- dts/bindings/i2c/nordic,nrf-twi-common.yaml | 2 +- .../serial/nordic,nrf-uart-common.yaml | 2 +- dts/bindings/spi/nordic,nrf-spi-common.yaml | 2 +- dts/common/nordic/nrf54h20.dtsi | 60 ------------------- 4 files changed, 3 insertions(+), 63 deletions(-) diff --git a/dts/bindings/i2c/nordic,nrf-twi-common.yaml b/dts/bindings/i2c/nordic,nrf-twi-common.yaml index c4dcda2b415..a2052e360d1 100644 --- a/dts/bindings/i2c/nordic,nrf-twi-common.yaml +++ b/dts/bindings/i2c/nordic,nrf-twi-common.yaml @@ -4,7 +4,7 @@ # Common fields for Nordic nRF family TWI peripherals -include: [i2c-controller.yaml, pinctrl-device.yaml, nordic-clockpin.yaml] +include: [i2c-controller.yaml, pinctrl-device.yaml] properties: reg: diff --git a/dts/bindings/serial/nordic,nrf-uart-common.yaml b/dts/bindings/serial/nordic,nrf-uart-common.yaml index c7182d9e145..b985b7bc963 100644 --- a/dts/bindings/serial/nordic,nrf-uart-common.yaml +++ b/dts/bindings/serial/nordic,nrf-uart-common.yaml @@ -1,4 +1,4 @@ -include: [uart-controller.yaml, pinctrl-device.yaml, nordic-clockpin.yaml] +include: [uart-controller.yaml, pinctrl-device.yaml] properties: reg: diff --git a/dts/bindings/spi/nordic,nrf-spi-common.yaml b/dts/bindings/spi/nordic,nrf-spi-common.yaml index f2a2ce8a8fc..ed504a5902b 100644 --- a/dts/bindings/spi/nordic,nrf-spi-common.yaml +++ b/dts/bindings/spi/nordic,nrf-spi-common.yaml @@ -3,7 +3,7 @@ # Common fields for Nordic nRF family SPI peripherals -include: [spi-controller.yaml, pinctrl-device.yaml, nordic-clockpin.yaml] +include: [spi-controller.yaml, pinctrl-device.yaml] properties: reg: diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index 7d49696af07..a5e086112ec 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -549,8 +549,6 @@ #size-cells = <0>; rx-delay-supported; rx-delay = <1>; - nordic,clockpin-enable = , - ; }; uart120: uart@8e6000 { @@ -571,8 +569,6 @@ #size-cells = <0>; rx-delay-supported; rx-delay = <1>; - nordic,clockpin-enable = , - ; }; cpuppr_vpr: vpr@908000 { @@ -847,8 +843,6 @@ easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; - nordic,clockpin-enable = , - ; }; spi130: spi@9a5000 { @@ -863,10 +857,6 @@ #size-cells = <0>; rx-delay-supported; rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; }; uart130: uart@9a5000 { @@ -875,7 +865,6 @@ status = "disabled"; interrupts = <421 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - nordic,clockpin-enable = ; }; i2c131: i2c@9a6000 { @@ -887,8 +876,6 @@ easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; - nordic,clockpin-enable = , - ; }; spi131: spi@9a6000 { @@ -903,10 +890,6 @@ #size-cells = <0>; rx-delay-supported; rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; }; uart131: uart@9a6000 { @@ -915,7 +898,6 @@ status = "disabled"; interrupts = <422 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - nordic,clockpin-enable = ; }; dppic134: dppic@9b1000 { @@ -964,8 +946,6 @@ easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; - nordic,clockpin-enable = , - ; }; spi132: spi@9b5000 { @@ -980,10 +960,6 @@ #size-cells = <0>; rx-delay-supported; rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; }; uart132: uart@9b5000 { @@ -992,7 +968,6 @@ status = "disabled"; interrupts = <437 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - nordic,clockpin-enable = ; }; i2c133: i2c@9b6000 { @@ -1004,8 +979,6 @@ easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; - nordic,clockpin-enable = , - ; }; spi133: spi@9b6000 { @@ -1020,10 +993,6 @@ #size-cells = <0>; rx-delay-supported; rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; }; uart133: uart@9b6000 { @@ -1032,7 +1001,6 @@ status = "disabled"; interrupts = <438 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - nordic,clockpin-enable = ; }; dppic135: dppic@9c1000 { @@ -1081,8 +1049,6 @@ easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; - nordic,clockpin-enable = , - ; }; spi134: spi@9c5000 { @@ -1097,10 +1063,6 @@ #size-cells = <0>; rx-delay-supported; rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; }; uart134: uart@9c5000 { @@ -1109,7 +1071,6 @@ status = "disabled"; interrupts = <453 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - nordic,clockpin-enable = ; }; i2c135: i2c@9c6000 { @@ -1121,8 +1082,6 @@ easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; - nordic,clockpin-enable = , - ; }; spi135: spi@9c6000 { @@ -1137,10 +1096,6 @@ #size-cells = <0>; rx-delay-supported; rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; }; uart135: uart@9c6000 { @@ -1149,7 +1104,6 @@ status = "disabled"; interrupts = <454 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - nordic,clockpin-enable = ; }; dppic136: dppic@9d1000 { @@ -1198,8 +1152,6 @@ easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; - nordic,clockpin-enable = , - ; }; spi136: spi@9d5000 { @@ -1214,10 +1166,6 @@ #size-cells = <0>; rx-delay-supported; rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; }; uart136: uart@9d5000 { @@ -1226,7 +1174,6 @@ status = "disabled"; interrupts = <469 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - nordic,clockpin-enable = ; }; i2c137: i2c@9d6000 { @@ -1238,8 +1185,6 @@ easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; - nordic,clockpin-enable = , - ; }; spi137: spi@9d6000 { @@ -1254,10 +1199,6 @@ #size-cells = <0>; rx-delay-supported; rx-delay = <1>; - nordic,clockpin-enable = , - , - , - ; }; uart137: uart@9d6000 { @@ -1266,7 +1207,6 @@ status = "disabled"; interrupts = <470 NRF_DEFAULT_IRQ_PRIORITY>; clocks = <&fll16m>; - nordic,clockpin-enable = ; }; }; }; From 9d332f5f2819a5fcfefcbd6e03500fe9b1c71049 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 078/825] Revert "[nrf fromtree] soc: nordic: pinctrl: rework nordic,clock-enable" This reverts commit 4a9113fb9a5dc94fae07e089f70918773d72e354. --- drivers/pinctrl/pinctrl_nrf.c | 2 +- dts/bindings/pinctrl/nordic-clockpin.yaml | 8 ---- .../zephyr/dt-bindings/pinctrl/nrf-pinctrl.h | 11 +++-- soc/nordic/common/pinctrl_soc.h | 44 +++---------------- 4 files changed, 12 insertions(+), 53 deletions(-) delete mode 100644 dts/bindings/pinctrl/nordic-clockpin.yaml diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index b83e7f48811..367ec8a380c 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -365,7 +365,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, nrf_gpio_cfg(pin, dir, input, NRF_GET_PULL(pins[i]), drive, NRF_GPIO_PIN_NOSENSE); #if NRF_GPIO_HAS_CLOCKPIN - nrf_gpio_pin_clock_set(pin, NRF_GET_CLOCKPIN_ENABLE(pins[i])); + nrf_gpio_pin_clock_set(pin, NRF_GET_CLOCK_ENABLE(pins[i])); #endif } } diff --git a/dts/bindings/pinctrl/nordic-clockpin.yaml b/dts/bindings/pinctrl/nordic-clockpin.yaml deleted file mode 100644 index 86f770c3871..00000000000 --- a/dts/bindings/pinctrl/nordic-clockpin.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -properties: - nordic,clockpin-enable: - type: array - description: | - List of signals that require CLOCKPIN setting enablement. diff --git a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h index 7afa6783814..242449b3267 100644 --- a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h +++ b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h @@ -10,8 +10,7 @@ * The whole nRF pin configuration information is encoded in a 32-bit bitfield * organized as follows: * - * - 31..18: Pin function. - * - 17: Clockpin enable. + * - 31..17: Pin function. * - 16: Pin inversion mode. * - 15: Pin low power mode. * - 14..11: Pin output drive configuration. @@ -28,10 +27,10 @@ #define NRF_FUN_POS 18U /** Mask for the function field. */ #define NRF_FUN_MSK 0x3FFFU -/** Position of the clockpin enable field. */ -#define NRF_CLOCKPIN_ENABLE_POS 17U -/** Mask for the clockpin enable field. */ -#define NRF_CLOCKPIN_ENABLE_MSK 0x1U +/** Position of the clock enable field. */ +#define NRF_CLOCK_ENABLE_POS 17U +/** Mask for the clock enable field. */ +#define NRF_CLOCK_ENABLE_MSK 0x1U /** Position of the invert field. */ #define NRF_INVERT_POS 16U /** Mask for the invert field. */ diff --git a/soc/nordic/common/pinctrl_soc.h b/soc/nordic/common/pinctrl_soc.h index ea0f0196e2b..292d58f489b 100644 --- a/soc/nordic/common/pinctrl_soc.h +++ b/soc/nordic/common/pinctrl_soc.h @@ -25,52 +25,21 @@ extern "C" { /** Type for nRF pin. */ typedef uint32_t pinctrl_soc_pin_t; -/** - * @brief Utility macro to check if a function requires clockpin enable. - * - * @param node_id Node identifier. - * @param prop Property name. - * @param idx Property entry index. - * @param p_node_id Parent node identifier. - */ -#define Z_CHECK_CLOCKPIN_ENABLE(node_id, prop, idx, fun) \ - DT_PROP_BY_IDX(node_id, prop, idx) == fun ? BIT(NRF_CLOCKPIN_ENABLE_POS) : - -/** - * @brief Utility macro compute the clockpin enable bit. - * - * @note DT_FOREACH_PROP_ELEM_SEP_VARGS() is used instead of - * DT_FOREACH_PROP_ELEM_VARGS() because the latter is already resolved in the - * same run. - * - * @param node_id Node identifier. - * @param prop Property name. - * @param idx Property entry index. - * @param p_node_id Parent node identifier. - */ -#define Z_GET_CLOCKPIN_ENABLE(node_id, prop, idx, p_node_id) \ - COND_CODE_1(DT_NODE_HAS_PROP(p_node_id, nordic_clockpin_enable), \ - ((DT_FOREACH_PROP_ELEM_SEP_VARGS( \ - p_node_id, nordic_clockpin_enable, Z_CHECK_CLOCKPIN_ENABLE, \ - (), NRF_GET_FUN(DT_PROP_BY_IDX(node_id, prop, idx))) \ - 0)), (0)) - /** * @brief Utility macro to initialize each pin. * * @param node_id Node identifier. * @param prop Property name. * @param idx Property entry index. - * @param p_node_id Parent node identifier. */ -#define Z_PINCTRL_STATE_PIN_INIT(node_id, prop, idx, p_node_id) \ +#define Z_PINCTRL_STATE_PIN_INIT(node_id, prop, idx) \ (DT_PROP_BY_IDX(node_id, prop, idx) | \ ((NRF_PULL_DOWN * DT_PROP(node_id, bias_pull_down)) << NRF_PULL_POS) |\ ((NRF_PULL_UP * DT_PROP(node_id, bias_pull_up)) << NRF_PULL_POS) | \ (DT_PROP(node_id, nordic_drive_mode) << NRF_DRIVE_POS) | \ ((NRF_LP_ENABLE * DT_PROP(node_id, low_power_enable)) << NRF_LP_POS) |\ (DT_PROP(node_id, nordic_invert) << NRF_INVERT_POS) | \ - Z_GET_CLOCKPIN_ENABLE(node_id, prop, idx, p_node_id) \ + (DT_PROP(node_id, nordic_clock_enable) << NRF_CLOCK_ENABLE_POS) \ ), /** @@ -81,8 +50,8 @@ typedef uint32_t pinctrl_soc_pin_t; */ #define Z_PINCTRL_STATE_PINS_INIT(node_id, prop) \ {DT_FOREACH_CHILD_VARGS(DT_PHANDLE(node_id, prop), \ - DT_FOREACH_PROP_ELEM_VARGS, psels, \ - Z_PINCTRL_STATE_PIN_INIT, node_id)} + DT_FOREACH_PROP_ELEM, psels, \ + Z_PINCTRL_STATE_PIN_INIT)} /** * @brief Utility macro to obtain pin function. @@ -92,12 +61,11 @@ typedef uint32_t pinctrl_soc_pin_t; #define NRF_GET_FUN(pincfg) (((pincfg) >> NRF_FUN_POS) & NRF_FUN_MSK) /** - * @brief Utility macro to obtain pin clockpin enable flag. + * @brief Utility macro to obtain pin clock enable flag. * * @param pincfg Pin configuration bit field. */ -#define NRF_GET_CLOCKPIN_ENABLE(pincfg) \ - (((pincfg) >> NRF_CLOCKPIN_ENABLE_POS) & NRF_CLOCKPIN_ENABLE_MSK) +#define NRF_GET_CLOCK_ENABLE(pincfg) (((pincfg) >> NRF_CLOCK_ENABLE_POS) & NRF_CLOCK_ENABLE_MSK) /** * @brief Utility macro to obtain pin inversion flag. From 50c7b14a30c9e9c87b50418d298746edd408c077 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 079/825] Revert "[nrf fromtree] drivers: pinctrl: nrf: add support for nordic,clock-enable" This reverts commit 1dafeb58f755db48bc5e0ace8dbc8b3ed365cea9. --- drivers/pinctrl/pinctrl_nrf.c | 32 ++++++++++++++++++- .../zephyr/dt-bindings/pinctrl/nrf-pinctrl.h | 8 ++--- soc/nordic/common/pinctrl_soc.h | 10 +----- 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/drivers/pinctrl/pinctrl_nrf.c b/drivers/pinctrl/pinctrl_nrf.c index 367ec8a380c..17193c160ca 100644 --- a/drivers/pinctrl/pinctrl_nrf.c +++ b/drivers/pinctrl/pinctrl_nrf.c @@ -101,6 +101,9 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uint32_t write = NO_WRITE; nrf_gpio_pin_dir_t dir; nrf_gpio_pin_input_t input; +#if NRF_GPIO_HAS_CLOCKPIN + bool clockpin = false; +#endif if (drive_idx < ARRAY_SIZE(drive_modes)) { drive = drive_modes[drive_idx]; @@ -119,6 +122,9 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, write = 1U; dir = NRF_GPIO_PIN_DIR_OUTPUT; input = NRF_GPIO_PIN_INPUT_DISCONNECT; +#if NRF_GPIO_HAS_CLOCKPIN && defined(NRF_UARTE_CLOCKPIN_TXD_NEEDED) + clockpin = true; +#endif break; case NRF_FUN_UART_RX: NRF_PSEL_UART(reg, RXD) = psel; @@ -130,6 +136,9 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, write = 1U; dir = NRF_GPIO_PIN_DIR_OUTPUT; input = NRF_GPIO_PIN_INPUT_DISCONNECT; +#if NRF_GPIO_HAS_CLOCKPIN && defined(NRF_UARTE_CLOCKPIN_RTS_NEEDED) + clockpin = true; +#endif break; case NRF_FUN_UART_CTS: NRF_PSEL_UART(reg, CTS) = psel; @@ -143,12 +152,21 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, write = 0U; dir = NRF_GPIO_PIN_DIR_OUTPUT; input = NRF_GPIO_PIN_INPUT_CONNECT; +#if NRF_GPIO_HAS_CLOCKPIN && defined(NRF_SPIM_CLOCKPIN_SCK_NEEDED) + clockpin = true; +#endif break; case NRF_FUN_SPIM_MOSI: NRF_PSEL_SPIM(reg, MOSI) = psel; write = 0U; dir = NRF_GPIO_PIN_DIR_OUTPUT; input = NRF_GPIO_PIN_INPUT_DISCONNECT; +#if NRF_GPIO_HAS_CLOCKPIN && defined(NRF_SPIM_CLOCKPIN_MOSI_NEEDED) + /* CLOCKPIN setting must not be applied to SPIM12x instances. */ + if (!NRF_SPIM_IS_320MHZ_SPIM((void *)reg)) { + clockpin = true; + } +#endif break; case NRF_FUN_SPIM_MISO: NRF_PSEL_SPIM(reg, MISO) = psel; @@ -161,6 +179,9 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, NRF_PSEL_SPIS(reg, SCK) = psel; dir = NRF_GPIO_PIN_DIR_INPUT; input = NRF_GPIO_PIN_INPUT_CONNECT; +#if NRF_GPIO_HAS_CLOCKPIN && defined(NRF_SPIS_CLOCKPIN_SCK_NEEDED) + clockpin = true; +#endif break; case NRF_FUN_SPIS_MOSI: NRF_PSEL_SPIS(reg, MOSI) = psel; @@ -171,6 +192,9 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, NRF_PSEL_SPIS(reg, MISO) = psel; dir = NRF_GPIO_PIN_DIR_INPUT; input = NRF_GPIO_PIN_INPUT_DISCONNECT; +#if NRF_GPIO_HAS_CLOCKPIN && defined(NRF_SPIS_CLOCKPIN_MISO_NEEDED) + clockpin = true; +#endif break; case NRF_FUN_SPIS_CSN: NRF_PSEL_SPIS(reg, CSN) = psel; @@ -192,6 +216,9 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, } dir = NRF_GPIO_PIN_DIR_INPUT; input = NRF_GPIO_PIN_INPUT_CONNECT; +#if NRF_GPIO_HAS_CLOCKPIN && defined(NRF_TWIM_CLOCKPIN_SCL_NEEDED) + clockpin = true; +#endif break; case NRF_FUN_TWIM_SDA: NRF_PSEL_TWIM(reg, SDA) = psel; @@ -200,6 +227,9 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, } dir = NRF_GPIO_PIN_DIR_INPUT; input = NRF_GPIO_PIN_INPUT_CONNECT; +#if NRF_GPIO_HAS_CLOCKPIN && defined(NRF_TWIM_CLOCKPIN_SDA_NEEDED) + clockpin = true; +#endif break; #endif /* defined(NRF_PSEL_TWIM) */ #if defined(NRF_PSEL_I2S) @@ -365,7 +395,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, nrf_gpio_cfg(pin, dir, input, NRF_GET_PULL(pins[i]), drive, NRF_GPIO_PIN_NOSENSE); #if NRF_GPIO_HAS_CLOCKPIN - nrf_gpio_pin_clock_set(pin, NRF_GET_CLOCK_ENABLE(pins[i])); + nrf_gpio_pin_clock_set(pin, clockpin); #endif } } diff --git a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h index 242449b3267..bdb370d2638 100644 --- a/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h +++ b/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h @@ -24,13 +24,9 @@ */ /** Position of the function field. */ -#define NRF_FUN_POS 18U +#define NRF_FUN_POS 17U /** Mask for the function field. */ -#define NRF_FUN_MSK 0x3FFFU -/** Position of the clock enable field. */ -#define NRF_CLOCK_ENABLE_POS 17U -/** Mask for the clock enable field. */ -#define NRF_CLOCK_ENABLE_MSK 0x1U +#define NRF_FUN_MSK 0x7FFFU /** Position of the invert field. */ #define NRF_INVERT_POS 16U /** Mask for the invert field. */ diff --git a/soc/nordic/common/pinctrl_soc.h b/soc/nordic/common/pinctrl_soc.h index 292d58f489b..8f0c2e504f1 100644 --- a/soc/nordic/common/pinctrl_soc.h +++ b/soc/nordic/common/pinctrl_soc.h @@ -38,8 +38,7 @@ typedef uint32_t pinctrl_soc_pin_t; ((NRF_PULL_UP * DT_PROP(node_id, bias_pull_up)) << NRF_PULL_POS) | \ (DT_PROP(node_id, nordic_drive_mode) << NRF_DRIVE_POS) | \ ((NRF_LP_ENABLE * DT_PROP(node_id, low_power_enable)) << NRF_LP_POS) |\ - (DT_PROP(node_id, nordic_invert) << NRF_INVERT_POS) | \ - (DT_PROP(node_id, nordic_clock_enable) << NRF_CLOCK_ENABLE_POS) \ + (DT_PROP(node_id, nordic_invert) << NRF_INVERT_POS) \ ), /** @@ -60,13 +59,6 @@ typedef uint32_t pinctrl_soc_pin_t; */ #define NRF_GET_FUN(pincfg) (((pincfg) >> NRF_FUN_POS) & NRF_FUN_MSK) -/** - * @brief Utility macro to obtain pin clock enable flag. - * - * @param pincfg Pin configuration bit field. - */ -#define NRF_GET_CLOCK_ENABLE(pincfg) (((pincfg) >> NRF_CLOCK_ENABLE_POS) & NRF_CLOCK_ENABLE_MSK) - /** * @brief Utility macro to obtain pin inversion flag. * From 7e98a881b6a8150da041f13fdc417a0b7becf101 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 080/825] Revert "[nrf fromtree] modules: hal_nordic: require nrf-regtool 5.6.0" This reverts commit 6294dd614aac1b5d0e205a2d09757f68cf3fd8de. --- 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 2ba8eea33a0..6171dacbd13 100644 --- a/modules/hal_nordic/CMakeLists.txt +++ b/modules/hal_nordic/CMakeLists.txt @@ -15,7 +15,7 @@ if(CONFIG_NRF_REGTOOL_GENERATE_BICR) list(APPEND nrf_regtool_components GENERATE:BICR) endif() if(DEFINED nrf_regtool_components) - find_package(nrf-regtool 5.6.0 EXACT REQUIRED + find_package(nrf-regtool 5.5.1 EXACT REQUIRED COMPONENTS ${nrf_regtool_components} PATHS ${CMAKE_CURRENT_LIST_DIR}/nrf-regtool NO_CMAKE_PATH From be6362351534c206f30eaeba9d19d0ba73d9dced Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 081/825] Revert "[nrf noup] doc: extensions: domain: skip patching doxygen groups" This reverts commit 83195a39ab74db0debb05c3ac07f35d56c33fb75. --- doc/_extensions/zephyr/domain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/_extensions/zephyr/domain.py b/doc/_extensions/zephyr/domain.py index b57430f99e3..92bb50cfd78 100644 --- a/doc/_extensions/zephyr/domain.py +++ b/doc/_extensions/zephyr/domain.py @@ -324,7 +324,7 @@ def setup(app): app.add_post_transform(ProcessRelatedCodeSamplesNode) # monkey-patching of the DoxygenGroupDirective - # app.add_directive("doxygengroup", CustomDoxygenGroupDirective, override=True) + app.add_directive("doxygengroup", CustomDoxygenGroupDirective, override=True) return { "version": __version__, From 2ac701983df9b31c9afc3eeaa4729be23f393f48 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 082/825] Revert "[nrf fromtree] doc: zephyr_domain: Show code samples after doxygengroups" This reverts commit 33102a92ea34fe0ebbfcce99ed723a07cde8b0d4. --- doc/_extensions/zephyr/domain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/_extensions/zephyr/domain.py b/doc/_extensions/zephyr/domain.py index 92bb50cfd78..f40b03a6c51 100644 --- a/doc/_extensions/zephyr/domain.py +++ b/doc/_extensions/zephyr/domain.py @@ -310,7 +310,7 @@ def run(self) -> List[Node]: nodes = super().run() if self.config.zephyr_breathe_insert_related_samples: - return [*nodes, RelatedCodeSamplesNode(id=self.arguments[0])] + return [RelatedCodeSamplesNode(id=self.arguments[0]), *nodes] else: return nodes From ff3983ba8b807f509f39849a84e559c93a8d7d6f Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 083/825] Revert "[nrf fromtree] doc: enable doxybridge" This reverts commit 5c3fdafb2755ebf453087adca26b7de498b38e9e. --- doc/conf.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index b9220c7d1e6..beebc8a85c0 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -88,7 +88,6 @@ "sphinx_sitemap", "zephyr.warnings_filter", "zephyr.doxyrunner", - "zephyr.doxybridge", "zephyr.gh_utils", "zephyr.manifest_projects_table", "notfound.extension", @@ -245,10 +244,6 @@ doxyrunner_fmt_vars = {"ZEPHYR_BASE": str(ZEPHYR_BASE), "ZEPHYR_VERSION": version} doxyrunner_outdir_var = "DOXY_OUT" -# -- Options for zephyr.doxybridge plugin --------------------------------- - -doxybridge_dir = doxyrunner_outdir - # -- Options for html_redirect plugin ------------------------------------- html_redirect_pages = redirects.REDIRECTS From dfd8e053ebbb1f1dfc297b468790d44a7b945ff8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 084/825] Revert "[nrf fromtree] doc: extensions: add doxybridge" This reverts commit 0cbbae51a72962615e05bc14ddbb0ac9cc77f4ce. --- doc/_extensions/zephyr/domain.py | 4 +- doc/_extensions/zephyr/doxybridge.py | 235 --------------------------- doc/_static/css/custom.css | 12 -- 3 files changed, 2 insertions(+), 249 deletions(-) delete mode 100644 doc/_extensions/zephyr/doxybridge.py diff --git a/doc/_extensions/zephyr/domain.py b/doc/_extensions/zephyr/domain.py index f40b03a6c51..66327f9c7ad 100644 --- a/doc/_extensions/zephyr/domain.py +++ b/doc/_extensions/zephyr/domain.py @@ -48,6 +48,7 @@ """ from typing import Any, Dict, Iterator, List, Tuple +from breathe.directives.content_block import DoxygenGroupDirective from docutils import nodes from docutils.nodes import Node from docutils.parsers.rst import Directive, directives @@ -58,7 +59,6 @@ from sphinx.transforms.post_transforms import SphinxPostTransform from sphinx.util import logging from sphinx.util.nodes import NodeMatcher, make_refnode -from zephyr.doxybridge import DoxygenGroupDirective from zephyr.gh_utils import gh_link_get_url import json @@ -323,7 +323,7 @@ def setup(app): app.add_transform(ConvertCodeSampleNode) app.add_post_transform(ProcessRelatedCodeSamplesNode) - # monkey-patching of the DoxygenGroupDirective + # monkey-patching of Breathe's DoxygenGroupDirective app.add_directive("doxygengroup", CustomDoxygenGroupDirective, override=True) return { diff --git a/doc/_extensions/zephyr/doxybridge.py b/doc/_extensions/zephyr/doxybridge.py deleted file mode 100644 index b15b1fc2f9a..00000000000 --- a/doc/_extensions/zephyr/doxybridge.py +++ /dev/null @@ -1,235 +0,0 @@ -""" -Copyright (c) 2021 Nordic Semiconductor ASA -Copyright (c) 2024 The Linux Foundation -SPDX-License-Identifier: Apache-2.0 -""" - -import os -from typing import Any, Dict - -import concurrent.futures - -from docutils import nodes - -from sphinx import addnodes -from sphinx.application import Sphinx -from sphinx.transforms.post_transforms import SphinxPostTransform -from sphinx.util import logging -from sphinx.util.docutils import SphinxDirective -from sphinx.domains.c import CXRefRole - -import doxmlparser -from doxmlparser.compound import DoxCompoundKind, DoxMemberKind - -logger = logging.getLogger(__name__) - - -KIND_D2S = { - DoxMemberKind.DEFINE: "macro", - DoxMemberKind.VARIABLE: "var", - DoxMemberKind.TYPEDEF: "type", - DoxMemberKind.ENUM: "enum", - DoxMemberKind.FUNCTION: "func", -} - - -class DoxygenGroupDirective(SphinxDirective): - has_content = False - required_arguments = 1 - optional_arguments = 0 - - def run(self): - - desc_node = addnodes.desc() - desc_node["domain"] = "c" - desc_node["objtype"] = "group" - - title_signode = addnodes.desc_signature() - group_xref = addnodes.pending_xref( - "", - refdomain="c", - reftype="group", - reftarget=self.arguments[0], - refwarn=True, - ) - group_xref += nodes.Text(self.arguments[0]) - title_signode += group_xref - - desc_node.append(title_signode) - - return [desc_node] - - -class DoxygenReferencer(SphinxPostTransform): - """Mapping between Doxygen memberdef kind and Sphinx kinds""" - - default_priority = 5 - - def run(self, **kwargs: Any) -> None: - for node in self.document.traverse(addnodes.pending_xref): - if node.get("refdomain") != "c": - continue - - reftype = node.get("reftype") - - # "member", "data" and "var" are equivalent as per Sphinx documentation for C domain - if reftype in ("member", "data"): - reftype = "var" - - entry = self.app.env.doxybridge_cache.get(reftype) - if not entry: - continue - - reftarget = node.get("reftarget").replace(".", "::").rstrip("()") - id = entry.get(reftarget) - if not id: - if reftype == "func": - # macros are sometimes referenced as functions, so try that - id = self.app.env.doxybridge_cache.get("macro").get(reftarget) - if not id: - continue - else: - continue - - if reftype in ("struct", "union", "group"): - doxygen_target = f"{id}.html" - else: - split = id.split("_") - doxygen_target = f"{'_'.join(split[:-1])}.html#{split[-1][1:]}" - - doxygen_target = str(self.app.config.doxybridge_dir) + "/html/" + doxygen_target - - doc_dir = os.path.dirname(self.document.get("source")) - doc_dest = os.path.join( - self.app.outdir, - os.path.relpath(doc_dir, self.app.srcdir), - ) - rel_uri = os.path.relpath(doxygen_target, doc_dest) - - refnode = nodes.reference("", "", internal=True, refuri=rel_uri, reftitle="") - - refnode.append(node[0].deepcopy()) - - if reftype == "group": - refnode["classes"].append("doxygroup") - title = self.app.env.doxybridge_group_titles.get(reftarget, "group") - refnode[0] = nodes.Text(title) - - node.replace_self([refnode]) - - -def parse_members(sectiondef): - cache = {} - - for memberdef in sectiondef.get_memberdef(): - kind = KIND_D2S.get(memberdef.get_kind()) - if not kind: - continue - - id = memberdef.get_id() - if memberdef.get_kind() == DoxMemberKind.VARIABLE: - name = memberdef.get_qualifiedname() or memberdef.get_name() - else: - name = memberdef.get_name() - - cache.setdefault(kind, {})[name] = id - - if memberdef.get_kind() == DoxMemberKind.ENUM: - for enumvalue in memberdef.get_enumvalue(): - enumname = enumvalue.get_name() - enumid = enumvalue.get_id() - cache.setdefault("enumerator", {})[enumname] = enumid - - return cache - - -def parse_sections(compounddef): - cache = {} - - for sectiondef in compounddef.get_sectiondef(): - members = parse_members(sectiondef) - for kind, data in members.items(): - cache.setdefault(kind, {}).update(data) - - return cache - - -def parse_compound(inDirName, baseName) -> Dict: - rootObj = doxmlparser.compound.parse(inDirName + "/" + baseName + ".xml", True) - cache = {} - group_titles = {} - - for compounddef in rootObj.get_compounddef(): - name = compounddef.get_compoundname() - id = compounddef.get_id() - kind = None - if compounddef.get_kind() == DoxCompoundKind.STRUCT: - kind = "struct" - elif compounddef.get_kind() == DoxCompoundKind.UNION: - kind = "union" - elif compounddef.get_kind() == DoxCompoundKind.GROUP: - kind = "group" - group_titles[name] = compounddef.get_title() - - if kind: - cache.setdefault(kind, {})[name] = id - - sections = parse_sections(compounddef) - for kind, data in sections.items(): - cache.setdefault(kind, {}).update(data) - - return cache, group_titles - - -def parse_index(app: Sphinx, inDirName): - rootObj = doxmlparser.index.parse(inDirName + "/index.xml", True) - compounds = rootObj.get_compound() - - with concurrent.futures.ProcessPoolExecutor() as executor: - futures = [ - executor.submit(parse_compound, inDirName, compound.get_refid()) - for compound in compounds - ] - for future in concurrent.futures.as_completed(futures): - cache, group_titles = future.result() - for kind, data in cache.items(): - app.env.doxybridge_cache.setdefault(kind, {}).update(data) - app.env.doxybridge_group_titles.update(group_titles) - - -def doxygen_parse(app: Sphinx) -> None: - if not app.env.doxygen_input_changed: - return - - app.env.doxybridge_cache = { - "macro": {}, - "var": {}, - "type": {}, - "enum": {}, - "enumerator": {}, - "func": {}, - "union": {}, - "struct": {}, - "group": {}, - } - - app.env.doxybridge_group_titles = {} - - parse_index(app, str(app.config.doxybridge_dir / "xml")) - - -def setup(app: Sphinx) -> Dict[str, Any]: - app.add_config_value("doxybridge_dir", None, "env") - - app.add_directive("doxygengroup", DoxygenGroupDirective) - - app.add_role_to_domain("c", "group", CXRefRole()) - - app.add_post_transform(DoxygenReferencer) - app.connect("builder-inited", doxygen_parse) - - return { - "version": "0.1", - "parallel_read_safe": True, - "parallel_write_safe": True, - } diff --git a/doc/_static/css/custom.css b/doc/_static/css/custom.css index 0e656329215..a374fda4d37 100644 --- a/doc/_static/css/custom.css +++ b/doc/_static/css/custom.css @@ -950,15 +950,3 @@ dark-mode-toggle::part(toggleLabel){ #search-se-menu ul li.selected .fa-check { display: inline; } - -.doxygroup::after { - content: 'Doxygen'; - display: inline-block; - background-color: var(--admonition-note-title-background-color); - color: var(--admonition-note-title-color); - padding: 2px 8px; - border-radius: 12px; - margin-left: 8px; - font-size: 0.875em; - font-weight: bold; -} \ No newline at end of file From 78126e2c5bbeda620d3fdae813a0e85a60245a2c Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 085/825] Revert "[nrf fromtree] doc: deactivate breathe extension" This reverts commit 7bd2900f0cc4480fd7ba74b52567a1553f86c00e. --- doc/conf.py | 28 ++++++++++++++++++++++++++++ doc/known-warnings.txt | 22 ++++++++++++++++++++++ doc/requirements.txt | 1 + 3 files changed, 51 insertions(+) diff --git a/doc/conf.py b/doc/conf.py index beebc8a85c0..ff54dd2cc49 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -73,6 +73,7 @@ # -- General configuration ------------------------------------------------ extensions = [ + "breathe", "sphinx_rtd_theme", "sphinx.ext.todo", "sphinx.ext.extlinks", @@ -244,6 +245,33 @@ doxyrunner_fmt_vars = {"ZEPHYR_BASE": str(ZEPHYR_BASE), "ZEPHYR_VERSION": version} doxyrunner_outdir_var = "DOXY_OUT" +# -- Options for Breathe plugin ------------------------------------------- + +breathe_projects = {"Zephyr": str(doxyrunner_outdir / "xml")} +breathe_default_project = "Zephyr" +breathe_domain_by_extension = { + "h": "c", + "c": "c", +} +breathe_show_enumvalue_initializer = True +breathe_default_members = ("members", ) + +cpp_id_attributes = [ + "__syscall", + "__syscall_always_inline", + "__deprecated", + "__may_alias", + "__used", + "__unused", + "__weak", + "__attribute_const__", + "__DEPRECATED_MACRO", + "FUNC_NORETURN", + "__subsystem", + "ALWAYS_INLINE", +] +c_id_attributes = cpp_id_attributes + # -- Options for html_redirect plugin ------------------------------------- html_redirect_pages = redirects.REDIRECTS diff --git a/doc/known-warnings.txt b/doc/known-warnings.txt index 72ad03d55d5..35a0ed60b03 100644 --- a/doc/known-warnings.txt +++ b/doc/known-warnings.txt @@ -1,2 +1,24 @@ # Each line should contain the regular expression of a known Sphinx warning # that should be filtered out + +# Function and (enum or struct) name +.*Duplicate C declaration.*\n.*'\.\. c:.*:: flash_img_check'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: fs_statvfs'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*dmic_trigger.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: dma_config'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: net_if_mcast_monitor'.* + +# Struct and typedef name +.*Duplicate C declaration.*\n.*'\.\. c:.*:: zsock_fd_set'.* + +# Function and extern function +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*net_if_ipv4_addr_mask_cmp.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*net_if_ipv4_is_addr_bcast.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*net_if_ipv4_addr_lookup.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*net_if_ipv6_addr_lookup.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*net_if_ipv6_maddr_lookup.*'.* + +# Common field names +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*struct in_addr.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*struct in6_addr.*'.* +.*Duplicate C declaration.*\n.*'\.\. c:.*:: .*struct net_if.*'.* diff --git a/doc/requirements.txt b/doc/requirements.txt index 842bbe5832e..bb12e241930 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,5 +1,6 @@ # DOC: used to generate docs +breathe>=4.34 sphinx sphinx_rtd_theme~=2.0 sphinx-tabs From 473a5a8888e9e842c481b703717401dce8c2a502 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 086/825] Revert "[nrf fromtree] doc: Use basic ..doxygengroup syntax" This reverts commit fc571ff1ed3592a0447f5b72ec8326adb831da3d. --- doc/build/dts/api/api.rst | 1 + doc/connectivity/bluetooth/api/mesh/blob.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/blob_cli.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/blob_flash.rst | 1 + doc/connectivity/bluetooth/api/mesh/blob_srv.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/dfd_srv.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/dfu.rst | 6 ++++++ doc/connectivity/bluetooth/api/mesh/dfu_cli.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/dfu_srv.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/lcd_cli.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/lcd_srv.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/od_cli.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/od_srv.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/op_agg_cli.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/op_agg_srv.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/priv_beacon_cli.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/priv_beacon_srv.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/rpr_cli.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/rpr_srv.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/sar_cfg_cli.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/sar_cfg_srv.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/srpl_cli.rst | 2 ++ doc/connectivity/bluetooth/api/mesh/srpl_srv.rst | 2 ++ doc/hardware/peripherals/mdio.rst | 1 + doc/kernel/memory_management/demand_paging.rst | 3 +++ doc/kernel/memory_management/shared_multi_heap.rst | 1 + doc/kernel/services/other/version.rst | 1 + 27 files changed, 54 insertions(+) diff --git a/doc/build/dts/api/api.rst b/doc/build/dts/api/api.rst index d955e45b705..44b87653cc3 100644 --- a/doc/build/dts/api/api.rst +++ b/doc/build/dts/api/api.rst @@ -359,6 +359,7 @@ system-wide settings. The :c:func:`DT_CHOSEN()` macro can be used to get a node identifier for a chosen node. .. doxygengroup:: devicetree-generic-chosen + :project: Zephyr Zephyr-specific chosen nodes **************************** diff --git a/doc/connectivity/bluetooth/api/mesh/blob.rst b/doc/connectivity/bluetooth/api/mesh/blob.rst index a22fb3d1423..8395026afe4 100644 --- a/doc/connectivity/bluetooth/api/mesh/blob.rst +++ b/doc/connectivity/bluetooth/api/mesh/blob.rst @@ -191,3 +191,5 @@ API reference This section contains types and defines common to the BLOB Transfer models. .. doxygengroup:: bt_mesh_blob + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/blob_cli.rst b/doc/connectivity/bluetooth/api/mesh/blob_cli.rst index e5de74a64c6..b4193d50334 100644 --- a/doc/connectivity/bluetooth/api/mesh/blob_cli.rst +++ b/doc/connectivity/bluetooth/api/mesh/blob_cli.rst @@ -126,3 +126,5 @@ API reference ************* .. doxygengroup:: bt_mesh_blob_cli + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/blob_flash.rst b/doc/connectivity/bluetooth/api/mesh/blob_flash.rst index 294dc4ea0b1..5966fe3562b 100644 --- a/doc/connectivity/bluetooth/api/mesh/blob_flash.rst +++ b/doc/connectivity/bluetooth/api/mesh/blob_flash.rst @@ -32,3 +32,4 @@ API Reference ************* .. doxygengroup:: bt_mesh_blob_io_flash + :project: Zephyr diff --git a/doc/connectivity/bluetooth/api/mesh/blob_srv.rst b/doc/connectivity/bluetooth/api/mesh/blob_srv.rst index ac829fc14d5..0d13e92148e 100644 --- a/doc/connectivity/bluetooth/api/mesh/blob_srv.rst +++ b/doc/connectivity/bluetooth/api/mesh/blob_srv.rst @@ -96,3 +96,5 @@ API reference ************* .. doxygengroup:: bt_mesh_blob_srv + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/dfd_srv.rst b/doc/connectivity/bluetooth/api/mesh/dfd_srv.rst index 9ffcc91df71..8efc040a56c 100644 --- a/doc/connectivity/bluetooth/api/mesh/dfd_srv.rst +++ b/doc/connectivity/bluetooth/api/mesh/dfd_srv.rst @@ -37,3 +37,5 @@ API reference ************* .. doxygengroup:: bt_mesh_dfd_srv + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/dfu.rst b/doc/connectivity/bluetooth/api/mesh/dfu.rst index 233c2b29938..c83377aef85 100644 --- a/doc/connectivity/bluetooth/api/mesh/dfu.rst +++ b/doc/connectivity/bluetooth/api/mesh/dfu.rst @@ -371,7 +371,13 @@ API reference This section lists the types common to the Device Firmware Update mesh models. .. doxygengroup:: bt_mesh_dfd + :project: Zephyr + :members: .. doxygengroup:: bt_mesh_dfu + :project: Zephyr + :members: .. doxygengroup:: bt_mesh_dfu_metadata + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/dfu_cli.rst b/doc/connectivity/bluetooth/api/mesh/dfu_cli.rst index ab6f04596e1..71952999caa 100644 --- a/doc/connectivity/bluetooth/api/mesh/dfu_cli.rst +++ b/doc/connectivity/bluetooth/api/mesh/dfu_cli.rst @@ -12,3 +12,5 @@ API reference ************* .. doxygengroup:: bt_mesh_dfu_cli + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/dfu_srv.rst b/doc/connectivity/bluetooth/api/mesh/dfu_srv.rst index 683d7536fe7..105bdecb86c 100644 --- a/doc/connectivity/bluetooth/api/mesh/dfu_srv.rst +++ b/doc/connectivity/bluetooth/api/mesh/dfu_srv.rst @@ -128,3 +128,5 @@ API reference ************* .. doxygengroup:: bt_mesh_dfu_srv + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/lcd_cli.rst b/doc/connectivity/bluetooth/api/mesh/lcd_cli.rst index b64f5241e88..96189e21dd3 100644 --- a/doc/connectivity/bluetooth/api/mesh/lcd_cli.rst +++ b/doc/connectivity/bluetooth/api/mesh/lcd_cli.rst @@ -22,3 +22,5 @@ API reference ************* .. doxygengroup:: bt_mesh_large_comp_data_cli + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/lcd_srv.rst b/doc/connectivity/bluetooth/api/mesh/lcd_srv.rst index aeb772044de..f67b31c27f8 100644 --- a/doc/connectivity/bluetooth/api/mesh/lcd_srv.rst +++ b/doc/connectivity/bluetooth/api/mesh/lcd_srv.rst @@ -35,3 +35,5 @@ API reference ************* .. doxygengroup:: bt_mesh_large_comp_data_srv + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/od_cli.rst b/doc/connectivity/bluetooth/api/mesh/od_cli.rst index d7a8c9daa19..e419acb7572 100644 --- a/doc/connectivity/bluetooth/api/mesh/od_cli.rst +++ b/doc/connectivity/bluetooth/api/mesh/od_cli.rst @@ -33,3 +33,5 @@ API reference ************* .. doxygengroup:: bt_mesh_od_priv_proxy_cli + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/od_srv.rst b/doc/connectivity/bluetooth/api/mesh/od_srv.rst index e9944dc10b1..3c2f993bb30 100644 --- a/doc/connectivity/bluetooth/api/mesh/od_srv.rst +++ b/doc/connectivity/bluetooth/api/mesh/od_srv.rst @@ -24,3 +24,5 @@ API reference ************* .. doxygengroup:: bt_mesh_od_priv_proxy_srv + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/op_agg_cli.rst b/doc/connectivity/bluetooth/api/mesh/op_agg_cli.rst index de1f02b5259..4648b4495cd 100644 --- a/doc/connectivity/bluetooth/api/mesh/op_agg_cli.rst +++ b/doc/connectivity/bluetooth/api/mesh/op_agg_cli.rst @@ -27,3 +27,5 @@ API reference ************* .. doxygengroup:: bt_mesh_op_agg_cli + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/op_agg_srv.rst b/doc/connectivity/bluetooth/api/mesh/op_agg_srv.rst index 336180251f3..81bd4a90b22 100644 --- a/doc/connectivity/bluetooth/api/mesh/op_agg_srv.rst +++ b/doc/connectivity/bluetooth/api/mesh/op_agg_srv.rst @@ -28,3 +28,5 @@ API reference ************* .. doxygengroup:: bt_mesh_op_agg_srv + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/priv_beacon_cli.rst b/doc/connectivity/bluetooth/api/mesh/priv_beacon_cli.rst index 2d6063a1f95..c9bcc8e5eb1 100644 --- a/doc/connectivity/bluetooth/api/mesh/priv_beacon_cli.rst +++ b/doc/connectivity/bluetooth/api/mesh/priv_beacon_cli.rst @@ -31,3 +31,5 @@ API reference ************* .. doxygengroup:: bt_mesh_priv_beacon_cli + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/priv_beacon_srv.rst b/doc/connectivity/bluetooth/api/mesh/priv_beacon_srv.rst index 5376cd11a98..62450634a31 100644 --- a/doc/connectivity/bluetooth/api/mesh/priv_beacon_srv.rst +++ b/doc/connectivity/bluetooth/api/mesh/priv_beacon_srv.rst @@ -34,3 +34,5 @@ API reference ************* .. doxygengroup:: bt_mesh_priv_beacon_srv + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/rpr_cli.rst b/doc/connectivity/bluetooth/api/mesh/rpr_cli.rst index eef5b371abf..8a87939541a 100644 --- a/doc/connectivity/bluetooth/api/mesh/rpr_cli.rst +++ b/doc/connectivity/bluetooth/api/mesh/rpr_cli.rst @@ -138,3 +138,5 @@ API reference ************* .. doxygengroup:: bt_mesh_rpr_cli + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/rpr_srv.rst b/doc/connectivity/bluetooth/api/mesh/rpr_srv.rst index 7e7d7c6c04e..e51d3c8fac9 100644 --- a/doc/connectivity/bluetooth/api/mesh/rpr_srv.rst +++ b/doc/connectivity/bluetooth/api/mesh/rpr_srv.rst @@ -34,3 +34,5 @@ API reference ************* .. doxygengroup:: bt_mesh_rpr_srv + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/sar_cfg_cli.rst b/doc/connectivity/bluetooth/api/mesh/sar_cfg_cli.rst index 9883d935b55..1e2ab6c47a1 100644 --- a/doc/connectivity/bluetooth/api/mesh/sar_cfg_cli.rst +++ b/doc/connectivity/bluetooth/api/mesh/sar_cfg_cli.rst @@ -37,3 +37,5 @@ API reference ************* .. doxygengroup:: bt_mesh_sar_cfg_cli + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/sar_cfg_srv.rst b/doc/connectivity/bluetooth/api/mesh/sar_cfg_srv.rst index 00e65231c66..4280fae1350 100644 --- a/doc/connectivity/bluetooth/api/mesh/sar_cfg_srv.rst +++ b/doc/connectivity/bluetooth/api/mesh/sar_cfg_srv.rst @@ -27,3 +27,5 @@ API reference ************* .. doxygengroup:: bt_mesh_sar_cfg_srv + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/srpl_cli.rst b/doc/connectivity/bluetooth/api/mesh/srpl_cli.rst index ed594390e20..a5a9b7ba47f 100644 --- a/doc/connectivity/bluetooth/api/mesh/srpl_cli.rst +++ b/doc/connectivity/bluetooth/api/mesh/srpl_cli.rst @@ -31,3 +31,5 @@ API reference ************* .. doxygengroup:: bt_mesh_sol_pdu_rpl_cli + :project: Zephyr + :members: diff --git a/doc/connectivity/bluetooth/api/mesh/srpl_srv.rst b/doc/connectivity/bluetooth/api/mesh/srpl_srv.rst index c3567c5f616..ad8a26e4c44 100644 --- a/doc/connectivity/bluetooth/api/mesh/srpl_srv.rst +++ b/doc/connectivity/bluetooth/api/mesh/srpl_srv.rst @@ -30,3 +30,5 @@ API reference ************* .. doxygengroup:: bt_mesh_sol_pdu_rpl_srv + :project: Zephyr + :members: diff --git a/doc/hardware/peripherals/mdio.rst b/doc/hardware/peripherals/mdio.rst index d665f5cef7e..24a8e5ecb5a 100644 --- a/doc/hardware/peripherals/mdio.rst +++ b/doc/hardware/peripherals/mdio.rst @@ -17,3 +17,4 @@ API Reference ************* .. doxygengroup:: mdio_interface + :project: Zephyr diff --git a/doc/kernel/memory_management/demand_paging.rst b/doc/kernel/memory_management/demand_paging.rst index 54cee37c2a5..e870c8740e2 100644 --- a/doc/kernel/memory_management/demand_paging.rst +++ b/doc/kernel/memory_management/demand_paging.rst @@ -183,13 +183,16 @@ API Reference ************* .. doxygengroup:: mem-demand-paging + :project: Zephyr Eviction Algorithm APIs ======================= .. doxygengroup:: mem-demand-paging-eviction + :project: Zephyr Backing Store APIs ================== .. doxygengroup:: mem-demand-paging-backing-store + :project: Zephyr diff --git a/doc/kernel/memory_management/shared_multi_heap.rst b/doc/kernel/memory_management/shared_multi_heap.rst index 5b45db130a7..89458ecb927 100644 --- a/doc/kernel/memory_management/shared_multi_heap.rst +++ b/doc/kernel/memory_management/shared_multi_heap.rst @@ -79,3 +79,4 @@ The API does not enforce any attributes, but at least it defines the two most common ones: :c:enum:`SMH_REG_ATTR_CACHEABLE` and :c:enum:`SMH_REG_ATTR_NON_CACHEABLE` .. doxygengroup:: shared_multi_heap + :project: Zephyr diff --git a/doc/kernel/services/other/version.rst b/doc/kernel/services/other/version.rst index fba1bfbb6ef..dde8f693004 100644 --- a/doc/kernel/services/other/version.rst +++ b/doc/kernel/services/other/version.rst @@ -9,3 +9,4 @@ API Reference ************** .. doxygengroup:: version_apis + :content-only: From dedfada4498bfbd5ee75572d67db268442c4d4eb Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:53 +0200 Subject: [PATCH 087/825] Revert "[nrf fromtree] samples: drivers: clock_control_litex: clean up use of c domain roles" This reverts commit da0cf599ba11447d1acbe4a3e45049fe95b30f95. --- samples/drivers/clock_control_litex/README.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/samples/drivers/clock_control_litex/README.rst b/samples/drivers/clock_control_litex/README.rst index 6a710e164f5..c2fa951bd38 100644 --- a/samples/drivers/clock_control_litex/README.rst +++ b/samples/drivers/clock_control_litex/README.rst @@ -39,9 +39,12 @@ This configuration defines 2 clock outputs: ``clk0`` and ``clk1`` with default f Driver Usage ************ -The driver is interfaced with the :ref:`Clock Control API ` function ``clock_control_on()`` and a LiteX driver specific structure (:c:struct:`litex_clk_setup`). +The driver is interfaced with the :ref:`Clock Control API ` function ``clock_control_on()`` and a LiteX driver specific structure: -| To change clock parameter it is needed to cast a pointer to structure :c:struct:`litex_clk_setup` onto :c:type:`clock_control_subsys_t` and use it with :c:func:`clock_control_on()`. +.. doxygenstruct:: litex_clk_setup + :project: Zephyr + +| To change clock parameter it is needed to cast a pointer to structure ``litex_clk_setup`` onto ``clock_control_subsys_t`` and use it with ``clock_control_on()``. | This code will try to set on ``clk0`` frequency 50MHz, 90 degrees of phase offset and 75% duty cycle. .. code-block:: c From 06ec5a0025a1bdecc9f354670001fa83dd81fb7d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 088/825] Revert "[nrf fromtree] doc: mcumgr: fix mixed up occurrences of :c:enum: and :c:enumerator:" This reverts commit d62584357cb934b2017f2f89451a917aa445917f. --- doc/services/device_mgmt/mcumgr_callbacks.rst | 3 ++- doc/services/device_mgmt/mcumgr_handlers.rst | 6 +++--- doc/services/device_mgmt/smp_groups/smp_group_0.rst | 2 +- doc/services/device_mgmt/smp_groups/smp_group_1.rst | 8 ++++---- doc/services/device_mgmt/smp_groups/smp_group_3.rst | 4 ++-- doc/services/device_mgmt/smp_groups/smp_group_8.rst | 4 ++-- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/doc/services/device_mgmt/mcumgr_callbacks.rst b/doc/services/device_mgmt/mcumgr_callbacks.rst index 0ed8b580c75..7333f273f2b 100644 --- a/doc/services/device_mgmt/mcumgr_callbacks.rst +++ b/doc/services/device_mgmt/mcumgr_callbacks.rst @@ -192,7 +192,7 @@ the file should be allowed or not, note that this requires that :kconfig:option:`CONFIG_MCUMGR_GRP_FS_FILE_ACCESS_HOOK` be enabled to receive this callback. Two types of errors can be returned, the ``rc`` parameter can be set to an -:c:enum:`mcumgr_err_t` error code and :c:enumerator:`MGMT_CB_ERROR_RC` +:c:enumerator:`mcumgr_err_t` error code and :c:enumerator:`MGMT_CB_ERROR_RC` can be returned, or a group error code (introduced with version 2 of the MCUmgr protocol) can be set by setting the ``group`` value to the group and ``rc`` value to the group error code and returning :c:enumerator:`MGMT_CB_ERROR_ERR`. @@ -330,3 +330,4 @@ API Reference ************* .. doxygengroup:: mcumgr_callback_api + :inner: diff --git a/doc/services/device_mgmt/mcumgr_handlers.rst b/doc/services/device_mgmt/mcumgr_handlers.rst index 18fc5e65366..e189ea887d4 100644 --- a/doc/services/device_mgmt/mcumgr_handlers.rst +++ b/doc/services/device_mgmt/mcumgr_handlers.rst @@ -52,8 +52,8 @@ responses (which have unique error codes per group as opposed to the legacy SMP responses that return a :c:enum:`mcumgr_err_t` - there should always be an OK error code with the value 0 and an unknown error code with the value 1. The above example then adds an error code of ``not wanted`` with value 2. In addition, the group ID is set to be -:c:enumerator:`MGMT_GROUP_ID_PERUSER`, which is the start group ID for user-defined groups, note -that group IDs need to be unique so other custom groups should use different values, a central index +:c:enum:`MGMT_GROUP_ID_PERUSER`, which is the start group ID for user-defined groups, note that +group IDs need to be unique so other custom groups should use different values, a central index header file (as upstream Zephyr has) can be used to distribute group IDs more easily. Initial header _mgmt_callbacks.h @@ -70,7 +70,7 @@ file would look similar to: This sets up a single event which application (or module) code can register for to receive a callback when the function handler is executed, which allows the flow of the handler to be changed (i.e. to return an error instead of continuing). The event group ID is set to -:c:enumerator:`MGMT_EVT_GRP_USER_CUSTOM_START`, which is the start event ID for user-defined groups, +:c:enum:`MGMT_EVT_GRP_USER_CUSTOM_START`, which is the start event ID for user-defined groups, note that event IDs need to be unique so other custom groups should use different values, a central index header file (as upstream Zephyr has) can be used to distribute event IDs more easily. diff --git a/doc/services/device_mgmt/smp_groups/smp_group_0.rst b/doc/services/device_mgmt/smp_groups/smp_group_0.rst index eb3b90b3a1d..7fb91463e33 100644 --- a/doc/services/device_mgmt/smp_groups/smp_group_0.rst +++ b/doc/services/device_mgmt/smp_groups/smp_group_0.rst @@ -563,7 +563,7 @@ System reset request header fields: +--------+--------------+----------------+ Normally the command sends an empty CBOR map as data, but if a previous reset -attempt has responded with "rc" equal to :c:enumerator:`MGMT_ERR_EBUSY` then the +attempt has responded with "rc" equal to :c:enum:`MGMT_ERR_EBUSY` then the following map may be sent to force a reset: .. code-block:: none diff --git a/doc/services/device_mgmt/smp_groups/smp_group_1.rst b/doc/services/device_mgmt/smp_groups/smp_group_1.rst index 744835fad25..2a1d1f27086 100644 --- a/doc/services/device_mgmt/smp_groups/smp_group_1.rst +++ b/doc/services/device_mgmt/smp_groups/smp_group_1.rst @@ -204,7 +204,7 @@ where: | | using SMP version 1 or for SMP errors when using SMP version 2. | +------------------+-------------------------------------------------------------------------+ | "rsn" | optional string that clarifies reason for an error; specifically useful | - | | when ``rc`` is :c:enumerator:`MGMT_ERR_EUNKNOWN`. | + | | when ``rc`` is :c:enum:`MGMT_ERR_EUNKNOWN`. | +------------------+-------------------------------------------------------------------------+ .. note:: @@ -407,7 +407,7 @@ where: | | using SMP version 1 or for SMP errors when using SMP version 2. | +------------------+-------------------------------------------------------------------------+ | "rsn" | optional string that clarifies reason for an error; specifically useful | - | | when ``rc`` is :c:enumerator:`MGMT_ERR_EUNKNOWN`. | + | | when ``rc`` is :c:enum:`MGMT_ERR_EUNKNOWN`. | +------------------+-------------------------------------------------------------------------+ The "off" field is only included in responses to successfully processed requests; @@ -509,10 +509,10 @@ where: | | using SMP version 1 or for SMP errors when using SMP version 2. | +------------------+-------------------------------------------------------------------------+ | "rsn" | optional string that clarifies reason for an error; specifically useful | - | | when ``rc`` is :c:enumerator:`MGMT_ERR_EUNKNOWN`. | + | | when ``rc`` is :c:enum:`MGMT_ERR_EUNKNOWN`. | +------------------+-------------------------------------------------------------------------+ .. note:: Response from Zephyr running device may have "rc" value of - :c:enumerator:`MGMT_ERR_EBADSTATE`, which means that the secondary + :c:enum:`MGMT_ERR_EBADSTATE`, which means that the secondary image has been marked for next boot already and may not be erased. diff --git a/doc/services/device_mgmt/smp_groups/smp_group_3.rst b/doc/services/device_mgmt/smp_groups/smp_group_3.rst index b5fd66d3d60..0636e72e3f6 100644 --- a/doc/services/device_mgmt/smp_groups/smp_group_3.rst +++ b/doc/services/device_mgmt/smp_groups/smp_group_3.rst @@ -542,5 +542,5 @@ There is a settings access MCUmgr callback available (see :ref:`mcumgr_callbacks callbacks) which allows for applications/modules to know when settings management commands are used and, optionally, block access (for example through the use of a security mechanism). This callback can be enabled with :kconfig:option:`CONFIG_MCUMGR_GRP_SETTINGS_ACCESS_HOOK`, registered -with the event :c:enumerator:`MGMT_EVT_OP_SETTINGS_MGMT_ACCESS`, whereby the supplied callback data -is :c:struct:`settings_mgmt_access`. +with the event :c:enum:`MGMT_EVT_OP_SETTINGS_MGMT_ACCESS`, whereby the supplied callback data is +:c:struct:`settings_mgmt_access`. diff --git a/doc/services/device_mgmt/smp_groups/smp_group_8.rst b/doc/services/device_mgmt/smp_groups/smp_group_8.rst index 7a50ebf3d7c..502a5757169 100644 --- a/doc/services/device_mgmt/smp_groups/smp_group_8.rst +++ b/doc/services/device_mgmt/smp_groups/smp_group_8.rst @@ -47,7 +47,7 @@ requests or even be removed. However, if the Kconfig option :kconfig:option:`CONFIG_MCUMGR_GRP_FS_FILE_ACCESS_HOOK` is enabled, then an application can register a callback handler for - :c:enumerator:`MGMT_EVT_OP_FS_MGMT_FILE_ACCESS` (see + :c:enum:`MGMT_EVT_OP_FS_MGMT_FILE_ACCESS` (see :ref:`MCUmgr callbacks `), which allows for allowing or declining access to reading/writing a particular file, or for rewriting the path supplied by the client. @@ -185,7 +185,7 @@ change between requests or even be removed. However, if the Kconfig option :kconfig:option:`CONFIG_MCUMGR_GRP_FS_FILE_ACCESS_HOOK` is enabled, then an application can register a callback handler for - :c:enumerator:`MGMT_EVT_OP_FS_MGMT_FILE_ACCESS` (see + :c:enum:`MGMT_EVT_OP_FS_MGMT_FILE_ACCESS` (see :ref:`MCUmgr callbacks `), which allows for allowing or declining access to reading/writing a particular file, or for rewriting the path supplied by the client. From 25bd01eb9ac1d92d478863722cecedae730fcbbe Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 089/825] Revert "[nrf fromtree] doc: Add build env variable to know if doxygen has run" This reverts commit 1379a4bbf64b12b845afc4e84442f17188116fe1. --- doc/_extensions/zephyr/api_overview.py | 3 --- doc/_extensions/zephyr/doxyrunner.py | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/doc/_extensions/zephyr/api_overview.py b/doc/_extensions/zephyr/api_overview.py index 15bbe0e804b..74a4d35ba69 100644 --- a/doc/_extensions/zephyr/api_overview.py +++ b/doc/_extensions/zephyr/api_overview.py @@ -141,9 +141,6 @@ def sync_contents(app: Sphinx) -> None: else: doxygen_out_dir = Path(app.outdir) / "_doxygen" - if not app.env.doxygen_input_changed: - return - doxygen_xml_dir = doxygen_out_dir / "xml" groups = parse_xml_dir(doxygen_xml_dir) diff --git a/doc/_extensions/zephyr/doxyrunner.py b/doc/_extensions/zephyr/doxyrunner.py index 64d4a2c793a..8bd10e63a97 100644 --- a/doc/_extensions/zephyr/doxyrunner.py +++ b/doc/_extensions/zephyr/doxyrunner.py @@ -362,8 +362,8 @@ def doxygen_build(app: Sphinx) -> None: ) logger.info("Checking if Doxygen needs to be run...") - app.env.doxygen_input_changed = doxygen_input_has_changed(app.env, doxyfile) - if not app.env.doxygen_input_changed: + changed = doxygen_input_has_changed(app.env, doxyfile) + if not changed: logger.info("Doxygen build will be skipped (no changes)!") return From 42ffbb6a8a7c4695ed1fc283bba1a536e85af02e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 090/825] Revert "[nrf noup] dts: nordic: Support disabling lfosc" This reverts commit 681f57f50e864958da0d44a11778b882d8b366a3. --- dts/bindings/misc/nordic,nrf-bicr.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/dts/bindings/misc/nordic,nrf-bicr.yaml b/dts/bindings/misc/nordic,nrf-bicr.yaml index 60894ee2e1d..5b698613433 100644 --- a/dts/bindings/misc/nordic,nrf-bicr.yaml +++ b/dts/bindings/misc/nordic,nrf-bicr.yaml @@ -76,7 +76,6 @@ properties: - "crystal" - "external-sine" - "external-square" - - "disabled" lfosc-loadcap: type: int From 3e0bda01fcb64fbe397656011b03f672c34db60d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 091/825] Revert "[nrf fromtree] manifest: Update nRF hw models to latest" This reverts commit b53d93cd77e2097d1be3c966220f18c47bcd0040. --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 1da99e5545c..e94967ddad1 100644 --- a/west.yml +++ b/west.yml @@ -295,7 +295,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: 4b0b020e25dbf1a11ccccf7b7741d6ca991ba9e4 + revision: 6e70c2dc5d4c67c4da5913b2969c0774b27f0cd0 path: modules/bsim_hw_models/nrf_hw_models - name: open-amp revision: da78aea63159771956fe0c9263f2e6985b66e9d5 From 2f0c83666634bc6709af29585ad58d42e4b25e9f Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 092/825] Revert "[nrf fromtree] boards: nrf54l15bsim: Compare it to the DK instead of the PDK" This reverts commit fa4cc157ff1cd2183b217e32363a0dee23be325d. --- boards/native/nrf_bsim/doc/nrf54l15bsim.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/native/nrf_bsim/doc/nrf54l15bsim.rst b/boards/native/nrf_bsim/doc/nrf54l15bsim.rst index 61ad06c4aa5..6e7c12a5cdd 100644 --- a/boards/native/nrf_bsim/doc/nrf54l15bsim.rst +++ b/boards/native/nrf_bsim/doc/nrf54l15bsim.rst @@ -21,7 +21,7 @@ run applications natively on the development system. This has the benefit of providing native code execution performance and easy debugging using native tools, but inherits :ref:`its limitations `. -Just like for the nrf54l15dk target, +Just like for the nrf54l15pdk target, the nrf54l15bsim/nrf54l15/cpuapp build target provides support for the application core, on the simulated nRF54L15 SOC. @@ -51,7 +51,7 @@ This boards include models of some of the nRF54L15 SOC peripherals: * TIMER * UICR (User Information Configuration Registers) -and will use the same drivers as the nrf54l15dk targets for these. +and will use the same drivers as the nrf54l15pdk targets for these. For more information on what is modeled to which level of detail, check the `HW models implementation status`_. From 402ab953645ec009b0ee3accc51390c8eb6cbb9f Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 093/825] Revert "[nrf fromtree] boards: nrf54l15_bsim: Update docs including AAR,CCM, ECB" This reverts commit b30017ea871ac47033817e1ae827877445694ff6. --- boards/native/nrf_bsim/doc/nrf54l15bsim.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/boards/native/nrf_bsim/doc/nrf54l15bsim.rst b/boards/native/nrf_bsim/doc/nrf54l15bsim.rst index 6e7c12a5cdd..8c0b2fb64f0 100644 --- a/boards/native/nrf_bsim/doc/nrf54l15bsim.rst +++ b/boards/native/nrf_bsim/doc/nrf54l15bsim.rst @@ -31,15 +31,14 @@ on the simulated nRF54L15 SOC. .. warning:: - This target is experimental. + This target is experimental, and even though it includes models of the RADIO, it does not yet + include models of the AAR, CCM or ECB peripherals, so the BLE and 802.15.4 stacks can only be + run without encryption or privacy features so far. This boards include models of some of the nRF54L15 SOC peripherals: -* AAR (Accelerated Address Resolver) -* CCM (AES CCM mode encryption) * CLOCK (Clock control) * DPPI (Distributed Programmable Peripheral Interconnect) -* ECB (AES electronic codebook mode encryption) * EGU (Event Generator Unit) * FICR (Factory Information Configuration Registers) * GRTC (Global Real-time Counter) From bea8ccd8dabb541d6412c3e2011d223c977d576b Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 094/825] Revert "[nrf fromtree] boards: nrf54l15_bsim: Actively set psa-rng to disabled" This reverts commit f48231497934362ff605a61316823494fb03f737. --- boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts b/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts index 43ca4460f25..a1f33d68b07 100644 --- a/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts +++ b/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts @@ -66,10 +66,6 @@ status = "okay"; compatible = "zephyr,native-posix-rng"; }; - - psa_rng: psa-rng { - status = "disabled"; - }; }; &grtc { From a9cccb5bc6eab1dae1efec1c605d4244fde36712 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 095/825] Revert "[nrf fromtree] boards: nrf54l15bsim: DTS cleanup" This reverts commit 32c3e33902c1d6f90bd637d02a224b4e6cca1fd0. --- boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts b/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts index a1f33d68b07..bdcd1f2300b 100644 --- a/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts +++ b/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts @@ -60,6 +60,9 @@ /delete-node/ gpio@10a000; /delete-node/ gpiote@10c000; }; + /delete-node/ spu@50003000; + /delete-node/ gpiote@5000d000; + /delete-node/ crypto@50844000; }; rng: rng { From db257fe39f6f1e507d211a36519898682a679599 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 096/825] Revert "[nrf fromtree] tests: drivers: Extend coverage for NRF GRTC timer" This reverts commit 4d1484a22fea57e84f0487d68e44d5e44671062a. --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 5 -- tests/drivers/timer/nrf_grtc_timer/src/main.c | 83 ------------------- 2 files changed, 88 deletions(-) delete mode 100644 tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.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 deleted file mode 100644 index 04580b71480..00000000000 --- a/tests/drivers/timer/nrf_grtc_timer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,5 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -&grtc { - /delete-property/ child-owned-channels; -}; diff --git a/tests/drivers/timer/nrf_grtc_timer/src/main.c b/tests/drivers/timer/nrf_grtc_timer/src/main.c index 2fff9802d49..f8d33d8c53a 100644 --- a/tests/drivers/timer/nrf_grtc_timer/src/main.c +++ b/tests/drivers/timer/nrf_grtc_timer/src/main.c @@ -11,18 +11,6 @@ #define NUMBER_OF_TRIES 2000 #define CYC_PER_TICK \ ((uint64_t)sys_clock_hw_cycles_per_sec() / (uint64_t)CONFIG_SYS_CLOCK_TICKS_PER_SEC) -#define TIMER_COUNT_TIME_MS 10 -#define WAIT_FOR_TIMER_EVENT_TIME_MS TIMER_COUNT_TIME_MS + 5 - -static volatile uint8_t compare_isr_call_counter; - -/* GRTC timer compare interrupt handler */ -static void timer_compare_interrupt_handler(int32_t id, uint64_t expire_time, void *user_data) -{ - compare_isr_call_counter++; - TC_PRINT("Compare value reached, user data: '%s'\n", (char *)user_data); - TC_PRINT("Call counter: %d\n", compare_isr_call_counter); -} ZTEST(nrf_grtc_timer, test_get_ticks) { @@ -60,75 +48,4 @@ ZTEST(nrf_grtc_timer, test_get_ticks) } } -ZTEST(nrf_grtc_timer, test_timer_count_in_compare_mode) -{ - int err; - uint64_t test_ticks = 0; - uint64_t compare_value = 0; - char user_data[] = "test_timer_count_in_compare_mode\n"; - int32_t channel = z_nrf_grtc_timer_chan_alloc(); - - TC_PRINT("Allocated GRTC channel %d\n", channel); - if (channel < 0) { - TC_PRINT("Failed to allocate GRTC channel, chan=%d\n", channel); - ztest_test_fail(); - } - - compare_isr_call_counter = 0; - test_ticks = z_nrf_grtc_timer_get_ticks(K_MSEC(TIMER_COUNT_TIME_MS)); - err = z_nrf_grtc_timer_set(channel, test_ticks, timer_compare_interrupt_handler, - (void *)user_data); - - zassert_equal(err, 0, "z_nrf_grtc_timer_set raised an error: %d", err); - - z_nrf_grtc_timer_compare_read(channel, &compare_value); - zassert_true(K_TIMEOUT_EQ(K_TICKS(compare_value), K_TICKS(test_ticks)), - "Compare register set failed"); - zassert_equal(err, 0, "Unexpected error raised when setting timer, err: %d", err); - - k_sleep(K_MSEC(WAIT_FOR_TIMER_EVENT_TIME_MS)); - - TC_PRINT("Compare event generated ?: %d\n", z_nrf_grtc_timer_compare_evt_check(channel)); - TC_PRINT("Compare event register address: %X\n", - z_nrf_grtc_timer_compare_evt_address_get(channel)); - - zassert_equal(compare_isr_call_counter, 1, "Compare isr call counter: %d", - compare_isr_call_counter); - z_nrf_grtc_timer_chan_free(channel); -} - -ZTEST(nrf_grtc_timer, test_timer_abort_in_compare_mode) -{ - int err; - uint64_t test_ticks = 0; - uint64_t compare_value = 0; - char user_data[] = "test_timer_abort_in_compare_mode\n"; - int32_t channel = z_nrf_grtc_timer_chan_alloc(); - - TC_PRINT("Allocated GRTC channel %d\n", channel); - if (channel < 0) { - TC_PRINT("Failed to allocate GRTC channel, chan=%d\n", channel); - ztest_test_fail(); - } - - compare_isr_call_counter = 0; - test_ticks = z_nrf_grtc_timer_get_ticks(K_MSEC(TIMER_COUNT_TIME_MS)); - err = z_nrf_grtc_timer_set(channel, test_ticks, timer_compare_interrupt_handler, - (void *)user_data); - zassert_equal(err, 0, "z_nrf_grtc_timer_set raised an error: %d", err); - - z_nrf_grtc_timer_abort(channel); - - z_nrf_grtc_timer_compare_read(channel, &compare_value); - zassert_true(K_TIMEOUT_EQ(K_TICKS(compare_value), K_TICKS(test_ticks)), - "Compare register set failed"); - - zassert_equal(err, 0, "Unexpected error raised when setting timer, err: %d", err); - - k_sleep(K_MSEC(WAIT_FOR_TIMER_EVENT_TIME_MS)); - zassert_equal(compare_isr_call_counter, 0, "Compare isr call counter: %d", - compare_isr_call_counter); - z_nrf_grtc_timer_chan_free(channel); -} - ZTEST_SUITE(nrf_grtc_timer, NULL, NULL, NULL, NULL, NULL); From a399bcf4798eccdecec24d32603a57b03aea4856 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 097/825] Revert "[nrf fromlist] boards: nordic: nrf54l15dk: enable HWFC" This reverts commit ae886fe370f8eee945316d6add74b22dbe609eaa. --- boards/nordic/nrf54l15dk/nrf54l15_cpuapp_common.dtsi | 1 - boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts | 1 - 2 files changed, 2 deletions(-) diff --git a/boards/nordic/nrf54l15dk/nrf54l15_cpuapp_common.dtsi b/boards/nordic/nrf54l15dk/nrf54l15_cpuapp_common.dtsi index 4292e9a1523..191babb632f 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15_cpuapp_common.dtsi +++ b/boards/nordic/nrf54l15dk/nrf54l15_cpuapp_common.dtsi @@ -87,7 +87,6 @@ &uart20 { status = "okay"; - hw-flow-control; }; &gpio0 { diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts index a608941514e..472e3f2b8d3 100644 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts +++ b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts @@ -48,7 +48,6 @@ &uart30 { status = "okay"; - hw-flow-control; }; &gpio0 { From 3e864f57c72c0aa878cec9ad196b557335bc2eea Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 098/825] Revert "[nrf fromtree] tests: drivers: Allow configurable i2c speed for bme688 test" This reverts commit f7280aa69a2afcfddaa05b4ad52fcdaec01099e6. --- tests/drivers/i2c/i2c_bme688/Kconfig | 9 --------- tests/drivers/i2c/i2c_bme688/src/main.c | 6 ++---- 2 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 tests/drivers/i2c/i2c_bme688/Kconfig diff --git a/tests/drivers/i2c/i2c_bme688/Kconfig b/tests/drivers/i2c/i2c_bme688/Kconfig deleted file mode 100644 index 7ae057ebafe..00000000000 --- a/tests/drivers/i2c/i2c_bme688/Kconfig +++ /dev/null @@ -1,9 +0,0 @@ -# I2C BME688 test configuration options -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config TEST_I2C_SPEED - int "Select I2C speed used during the test, selectable options are: I2C_SPEED_STANDARD (0x1U), I2C_SPEED_FAST (0x2U), I2C_SPEED_FAST_PLUS (0x3U)" - default 1 - -source "Kconfig.zephyr" diff --git a/tests/drivers/i2c/i2c_bme688/src/main.c b/tests/drivers/i2c/i2c_bme688/src/main.c index 4563d74e9b3..9e21ef0b3e1 100644 --- a/tests/drivers/i2c/i2c_bme688/src/main.c +++ b/tests/drivers/i2c/i2c_bme688/src/main.c @@ -201,11 +201,10 @@ static uint16_t read_adc_humidity(void) ZTEST(i2c_controller_to_sensor, test_i2c_basic_memory_read) { int err; - uint32_t i2c_config = I2C_SPEED_SET(CONFIG_TEST_I2C_SPEED) | I2C_MODE_CONTROLLER; + uint32_t i2c_config = I2C_SPEED_SET(I2C_SPEED_FAST) | I2C_MODE_CONTROLLER; uint8_t entire_sensor_memory[SENSOR_MEMORY_SIZE_IN_BYTES] = {0}; TC_PRINT("Device address 0x%x\n", DEVICE_ADDRESS); - TC_PRINT("I2C speed setting: %d\n", CONFIG_TEST_I2C_SPEED); err = i2c_configure(i2c_device, i2c_config); zassert_equal(err, 0, "i2c_configure' failed with error: %d\n", err); @@ -251,11 +250,10 @@ ZTEST(i2c_controller_to_sensor, test_i2c_controlled_sensor_operation) int16_t temperature = 0; uint32_t pressure = 0; uint32_t humidity = 0; - uint32_t i2c_config = I2C_SPEED_SET(CONFIG_TEST_I2C_SPEED) | I2C_MODE_CONTROLLER; + uint32_t i2c_config = I2C_SPEED_SET(I2C_SPEED_STANDARD) | I2C_MODE_CONTROLLER; uint8_t measurements_left = MEASUREMENT_CYCLES + 1; TC_PRINT("Device address 0x%x\n", DEVICE_ADDRESS); - TC_PRINT("I2C speed setting: %d\n", CONFIG_TEST_I2C_SPEED); err = i2c_configure(i2c_device, i2c_config); zassert_equal(err, 0, "i2c_configure' failed with error: %d\n", err); From 6a0c8f2155aeffbb63242dc16dec157918aaf5bb Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 099/825] Revert "[nrf fromtree] scripts: pylib: twister: fix missing newlines at handler.log" This reverts commit 97b2b538eb5753acf46c10cc00e924b909f7a254. --- scripts/pylib/twister/twisterlib/handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pylib/twister/twisterlib/handlers.py b/scripts/pylib/twister/twisterlib/handlers.py index 5dd4340bc5e..e14c86719a7 100755 --- a/scripts/pylib/twister/twisterlib/handlers.py +++ b/scripts/pylib/twister/twisterlib/handlers.py @@ -422,7 +422,7 @@ def monitor_serial(self, ser, halt_event, harness): # is available yet. if serial_line: # can be more lines in serial_line so split them before handling - for sl in serial_line.decode('utf-8', 'ignore').splitlines(keepends=True): + for sl in serial_line.decode('utf-8', 'ignore').splitlines(): log_out_fp.write(strip_ansi_sequences(sl).encode('utf-8')) log_out_fp.flush() if sl := sl.strip(): From 1c7606021cdc749ea37947e1db642a642791b15e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 100/825] Revert "[nrf fromtree] tests: bluetooth: tester: add nrf54h20 configs" This reverts commit 64df5190709112eae313384ae188edb1a5670da7. --- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 23 ------------------- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 14 ----------- 2 files changed, 37 deletions(-) delete mode 100644 tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf delete mode 100644 tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf deleted file mode 100644 index 29139393b46..00000000000 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.conf +++ /dev/null @@ -1,23 +0,0 @@ -# CONFIG_TEST enforces minimal logging, which we don't want -CONFIG_TEST=n - -CONFIG_ASSERT=y -# Enable the option below to measure stack usage -#CONFIG_INIT_STACKS=y -CONFIG_THREAD_NAME=y -CONFIG_HW_STACK_PROTECTION=y - -CONFIG_LOG=y -CONFIG_LOG_BUFFER_SIZE=4096 -CONFIG_RTT_CONSOLE=y -CONFIG_LOG_BACKEND_RTT=y -CONFIG_LOG_BACKEND_RTT_MODE_DROP=y -CONFIG_USE_SEGGER_RTT=y -CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096 -CONFIG_LOG_BACKEND_SHOW_COLOR=n -CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1024 - -CONFIG_LOG_DEFAULT_LEVEL=3 -CONFIG_BTTESTER_LOG_LEVEL_DBG=y - -CONFIG_UART_INTERRUPT_DRIVEN=y diff --git a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index e6d4f675f57..00000000000 --- a/tests/bluetooth/tester/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -/ { - chosen { - zephyr,uart-pipe = &uart136; - }; -}; - -&uart136 { - compatible = "nordic,nrf-uarte"; - current-speed = <115200>; - status = "okay"; - hw-flow-control; -}; From c8bcfc401506d73c94d4998a753af768d4befa85 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 101/825] Revert "[nrf noup] scripts: west: build: Enable sysbuild by default globally" This reverts commit 1ab7966e9373453b22a712c0250fa24fd6dda587. --- scripts/west_commands/build.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/scripts/west_commands/build.py b/scripts/west_commands/build.py index 6f4222bc231..0bff7cbb0fb 100644 --- a/scripts/west_commands/build.py +++ b/scripts/west_commands/build.py @@ -9,6 +9,11 @@ import sys import yaml +from pathlib import Path +from zephyr_ext_common import ZEPHYR_BASE +sys.path.append(os.fspath(Path(__file__).parent.parent)) +import zephyr_module + from west import log from west.configuration import config from zcmake import DEFAULT_CMAKE_GENERATOR, run_cmake, run_build, CMakeCache @@ -578,8 +583,20 @@ def _run_cmake(self, board, origin, cmake_opts): config_sysbuild = config_getboolean('sysbuild', None) if config_sysbuild is None: - # If no option is set, then enable sysbuild globally - config_sysbuild = True + # Check if this is an ncs-repo directory + allow_list = [ 'mcuboot', 'sidewalk', 'find-my', 'nrf', 'matter', 'suit-processor', + 'memfault-firmware-sdk', 'zscilib', 'uoscore-uedhoc', 'zcbor', + 'hal_nordic', 'ncs-example-application', 'ant' ] + config_sysbuild = False + + for module in zephyr_module.parse_modules(ZEPHYR_BASE, self.manifest): + if module.meta['name'] in allow_list and Path(self.source_dir).is_relative_to(module.project): + config_sysbuild = True + break + + if config_sysbuild is False and Path(self.source_dir).is_relative_to(ZEPHYR_BASE): + config_sysbuild = True + if self.args.sysbuild or (config_sysbuild and not self.args.no_sysbuild): cmake_opts.extend(['-S{}'.format(SYSBUILD_PROJ_DIR), From 5efd87457ffb85bdf411bede2e3fed5961cb431e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 102/825] Revert "[nrf fromtree] soc: nordic: Select new nrf54lx compatible kconfig option" This reverts commit 38d4172e79bfbafbd80d3d949958047fcf6cc374. --- soc/nordic/nrf54l/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 83abc541bac..2d0283bc245 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -4,7 +4,6 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_NRF54LX - select SOC_COMPATIBLE_NRF54LX select HAS_NRFX select HAS_NORDIC_DRIVERS select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE From 420d60750eaee201cccc7f17e9d21631c560b046 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 103/825] Revert "[nrf fromtree] boards: nrfbsim: Fix testargs with non host libC" This reverts commit bbbe36068baa85fca44e13add83c9665a9b27241. --- boards/native/nrf_bsim/nsi_if.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/boards/native/nrf_bsim/nsi_if.c b/boards/native/nrf_bsim/nsi_if.c index 1b2bdd78c1f..d0f45597fa3 100644 --- a/boards/native/nrf_bsim/nsi_if.c +++ b/boards/native/nrf_bsim/nsi_if.c @@ -14,7 +14,6 @@ #include "phy_sync_ctrl.h" #include "nsi_hw_scheduler.h" #include "nsi_cpu_ctrl.h" -#include "nsi_host_trampolines.h" /* * These hooks are to be named nsif_cpu_, for example nsif_cpu0_boot @@ -56,8 +55,8 @@ NATIVE_SIMULATOR_IF void nsif_cpun_save_test_arg(char *argv) { if (test_args.test_case_argc >= test_args.allocated_size) { test_args.allocated_size += TESTCASAE_ARGV_ALLOCSIZE; - test_args.test_case_argv = nsi_host_realloc(test_args.test_case_argv, - test_args.allocated_size * sizeof(char *)); + test_args.test_case_argv = realloc(test_args.test_case_argv, + test_args.allocated_size * sizeof(char *)); if (test_args.test_case_argv == NULL) { /* LCOV_EXCL_BR_LINE */ bs_trace_error_line("Can't allocate memory\n"); /* LCOV_EXCL_LINE */ } @@ -71,7 +70,7 @@ NATIVE_SIMULATOR_IF void nsif_cpun_save_test_arg(char *argv) static void test_args_free(void) { if (test_args.test_case_argv) { - nsi_host_free(test_args.test_case_argv); + free(test_args.test_case_argv); test_args.test_case_argv = NULL; } } From 10659ad3d49136b885e64b8a5dfac0b8239c55ce Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 104/825] Revert "[nrf fromtree] Bluetooth: Controller: Fix BT_CTLR_DATA_LEN_UPDATE_SUPPORT selection" This reverts commit 836ef4d4279280baf9785b7de5df7bc6b606742c. --- subsys/bluetooth/controller/Kconfig.ll_sw_split | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig.ll_sw_split b/subsys/bluetooth/controller/Kconfig.ll_sw_split index 26e8c7cf47e..e4428929e35 100644 --- a/subsys/bluetooth/controller/Kconfig.ll_sw_split +++ b/subsys/bluetooth/controller/Kconfig.ll_sw_split @@ -20,8 +20,7 @@ config BT_LLL_VENDOR_NORDIC select BT_CTLR_CONN_PARAM_REQ_SUPPORT select BT_CTLR_EXT_REJ_IND_SUPPORT select BT_CTLR_PER_INIT_FEAT_XCHG_SUPPORT - select BT_CTLR_DATA_LEN_UPDATE_SUPPORT if !BT_CTLR_LE_ENC_SUPPORT || \ - HAS_HW_NRF_CCM_LFLEN_8BIT || \ + select BT_CTLR_DATA_LEN_UPDATE_SUPPORT if HAS_HW_NRF_CCM_LFLEN_8BIT || \ BT_CTLR_DATA_LENGTH_CLEAR select BT_CTLR_PRIVACY_SUPPORT if !SOC_SERIES_NRF51X select BT_CTLR_EXT_SCAN_FP_SUPPORT From b56a022fdb2e11d9f00bfed82b796c7fa7949821 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:54 +0200 Subject: [PATCH 105/825] Revert "[nrf fromtree] Bluetooth: Controller: Use HAL to modify renamed registers in nRF54" This reverts commit 832e11096fdf25cf462230a3be4b8941e0552084. --- .../controller/ll_sw/nordic/hal/nrf5/radio/radio.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c index dc87ec8ab82..9d5357fba8b 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c @@ -375,7 +375,7 @@ void radio_freq_chan_set(uint32_t chan) void radio_whiten_iv_set(uint32_t iv) { - nrf_radio_datawhiteiv_set(NRF_RADIO, iv); + NRF_RADIO->DATAWHITEIV = iv; NRF_RADIO->PCNF1 &= ~RADIO_PCNF1_WHITEEN_Msk; NRF_RADIO->PCNF1 |= ((1UL) << RADIO_PCNF1_WHITEEN_Pos) & @@ -625,10 +625,12 @@ uint32_t radio_is_idle(void) void radio_crc_configure(uint32_t polynomial, uint32_t iv) { - nrf_radio_crc_configure(NRF_RADIO, - RADIO_CRCCNF_LEN_Three, - NRF_RADIO_CRC_ADDR_SKIP, - polynomial); + NRF_RADIO->CRCCNF = + (((RADIO_CRCCNF_SKIPADDR_Skip) << RADIO_CRCCNF_SKIPADDR_Pos) & + RADIO_CRCCNF_SKIPADDR_Msk) | + (((RADIO_CRCCNF_LEN_Three) << RADIO_CRCCNF_LEN_Pos) & + RADIO_CRCCNF_LEN_Msk); + NRF_RADIO->CRCPOLY = polynomial; NRF_RADIO->CRCINIT = iv; } From 5bfce450f02876d3adb4430e1c071daa82460e82 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 106/825] Revert "[nrf fromtree] Bluetooth: Controller: Correct power levels for bsim targets" This reverts commit 487f02cee025bcc25da54a852d71a682626e15de. --- subsys/bluetooth/controller/Kconfig | 40 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index e2e38bb7023..a19bd9f870b 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -292,83 +292,83 @@ config BT_CTLR_TX_PWR_PLUS_9 config BT_CTLR_TX_PWR_PLUS_8 bool "+8 dBm" - depends on HAS_HW_NRF_RADIO_TX_PWR_HIGH || SOC_SERIES_NRF54HX || SOC_COMPATIBLE_NRF54LX + depends on HAS_HW_NRF_RADIO_TX_PWR_HIGH || SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_PLUS_7 bool "+7 dBm" - depends on HAS_HW_NRF_RADIO_TX_PWR_HIGH || SOC_SERIES_NRF54HX || SOC_COMPATIBLE_NRF54LX + depends on HAS_HW_NRF_RADIO_TX_PWR_HIGH || SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_PLUS_6 bool "+6 dBm" - depends on HAS_HW_NRF_RADIO_TX_PWR_HIGH || SOC_SERIES_NRF54HX || SOC_COMPATIBLE_NRF54LX + depends on HAS_HW_NRF_RADIO_TX_PWR_HIGH || SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_PLUS_5 bool "+5 dBm" - depends on HAS_HW_NRF_RADIO_TX_PWR_HIGH || SOC_SERIES_NRF54HX || SOC_COMPATIBLE_NRF54LX + depends on HAS_HW_NRF_RADIO_TX_PWR_HIGH || SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_PLUS_4 bool "+4 dBm" - depends on SOC_SERIES_NRF51X || SOC_COMPATIBLE_NRF52X || SOC_SERIES_NRF54HX || SOC_COMPATIBLE_NRF54LX + depends on SOC_SERIES_NRF51X || SOC_COMPATIBLE_NRF52X || SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_PLUS_3 bool "+3 dBm" - depends on SOC_COMPATIBLE_NRF52X || SOC_COMPATIBLE_NRF53X || SOC_SERIES_NRF54HX || SOC_COMPATIBLE_NRF54LX + depends on SOC_COMPATIBLE_NRF52X || SOC_SERIES_NRF53X || SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_PLUS_2 bool "+2 dBm" - depends on HAS_HW_NRF_RADIO_TX_PWR_HIGH || SOC_COMPATIBLE_NRF53X || SOC_SERIES_NRF54HX || SOC_COMPATIBLE_NRF54LX + depends on HAS_HW_NRF_RADIO_TX_PWR_HIGH || SOC_SERIES_NRF53X || SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_PLUS_1 bool "+1 dBm" - depends on SOC_COMPATIBLE_NRF53X || SOC_SERIES_NRF54HX || SOC_COMPATIBLE_NRF54LX + depends on SOC_SERIES_NRF53X || SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_0 bool "0 dBm" config BT_CTLR_TX_PWR_MINUS_1 bool "-1 dBm" - depends on SOC_COMPATIBLE_NRF53X || SOC_SERIES_NRF54HX || SOC_COMPATIBLE_NRF54LX + depends on SOC_SERIES_NRF53X || SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_MINUS_2 bool "-2 dBm" - depends on SOC_COMPATIBLE_NRF53X || SOC_SERIES_NRF54HX || SOC_COMPATIBLE_NRF54LX + depends on SOC_SERIES_NRF53X || SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_MINUS_3 bool "-3 dBm" - depends on SOC_COMPATIBLE_NRF53X || SOC_COMPATIBLE_NRF54LX + depends on SOC_SERIES_NRF53X || SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_MINUS_4 bool "-4 dBm" config BT_CTLR_TX_PWR_MINUS_5 bool "-5 dBm" - depends on SOC_COMPATIBLE_NRF53X || SOC_COMPATIBLE_NRF54LX + depends on SOC_SERIES_NRF53X || SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_MINUS_6 bool "-6 dBm" - depends on SOC_COMPATIBLE_NRF53X || SOC_COMPATIBLE_NRF54LX + depends on SOC_SERIES_NRF53X || SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_MINUS_7 bool "-7 dBm" - depends on SOC_COMPATIBLE_NRF53X || SOC_COMPATIBLE_NRF54LX + depends on SOC_SERIES_NRF53X || SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_MINUS_8 bool "-8 dBm" config BT_CTLR_TX_PWR_MINUS_9 bool "-9 dBm" - depends on SOC_COMPATIBLE_NRF54LX + depends on SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_MINUS_10 bool "-10 dBm" - depends on SOC_COMPATIBLE_NRF54LX + depends on SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_MINUS_12 bool "-12 dBm" config BT_CTLR_TX_PWR_MINUS_14 bool "-14 dBm" - depends on SOC_COMPATIBLE_NRF54LX + depends on SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_MINUS_16 bool "-16 dBm" @@ -378,7 +378,7 @@ config BT_CTLR_TX_PWR_MINUS_20 config BT_CTLR_TX_PWR_MINUS_26 bool "-26 dBm" - depends on SOC_COMPATIBLE_NRF54LX + depends on SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_MINUS_30 bool "-30 dBm" @@ -386,11 +386,11 @@ config BT_CTLR_TX_PWR_MINUS_30 config BT_CTLR_TX_PWR_MINUS_40 bool "-40 dBm" - depends on SOC_COMPATIBLE_NRF52X || SOC_COMPATIBLE_NRF53X || SOC_SERIES_NRF54HX || SOC_COMPATIBLE_NRF54LX + depends on SOC_COMPATIBLE_NRF52X || SOC_SERIES_NRF53X || SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_MINUS_46 bool "-46 dBm" - depends on SOC_COMPATIBLE_NRF54LX + depends on SOC_SERIES_NRF54LX config BT_CTLR_TX_PWR_MINUS_70 bool "-70 dBm" From dab0f71bf2686fbae023542d58a90619d1d30b6c Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 107/825] Revert "[nrf fromtree] boards nrf54l15bsim: DT: Set radio status as ok" This reverts commit 54b3bc32bf24ba1617acd54f211ca05de98875c5. --- boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts | 1 - 1 file changed, 1 deletion(-) diff --git a/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts b/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts index bdcd1f2300b..91c2233d70b 100644 --- a/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts +++ b/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts @@ -95,7 +95,6 @@ }; &radio { - status = "okay"; /* This feature is not yet supported by the RADIO model */ /delete-property/ dfe-supported; }; From 777b254feebc0c8cccf92dace374354f3f4e0b97 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 108/825] Revert "[nrf fromtree] boards: nrf54l15bsim: Mention CLOCK" This reverts commit cd9946698e2be8bf575b4f998bea56362d32e1d0. --- boards/native/nrf_bsim/doc/nrf54l15bsim.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/boards/native/nrf_bsim/doc/nrf54l15bsim.rst b/boards/native/nrf_bsim/doc/nrf54l15bsim.rst index 8c0b2fb64f0..bb113510c4a 100644 --- a/boards/native/nrf_bsim/doc/nrf54l15bsim.rst +++ b/boards/native/nrf_bsim/doc/nrf54l15bsim.rst @@ -32,12 +32,11 @@ on the simulated nRF54L15 SOC. .. warning:: This target is experimental, and even though it includes models of the RADIO, it does not yet - include models of the AAR, CCM or ECB peripherals, so the BLE and 802.15.4 stacks can only be - run without encryption or privacy features so far. + include models of the AAR, CCM, ECB or CLOCK peripherals, so the BLE and 802.15.4 stacks cannot + be run on it yet. This boards include models of some of the nRF54L15 SOC peripherals: -* CLOCK (Clock control) * DPPI (Distributed Programmable Peripheral Interconnect) * EGU (Event Generator Unit) * FICR (Factory Information Configuration Registers) From 89db7a7372af333b16119520da65122317c22d9d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 109/825] Revert "[nrf fromtree] boards nrf54l15bsim: Default to build BT Controller if BT" This reverts commit fcbb3542b87e4613c73253c548db254b59c135be. --- boards/native/nrf_bsim/Kconfig.defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/native/nrf_bsim/Kconfig.defconfig b/boards/native/nrf_bsim/Kconfig.defconfig index 2ff17802977..8f418bc684b 100644 --- a/boards/native/nrf_bsim/Kconfig.defconfig +++ b/boards/native/nrf_bsim/Kconfig.defconfig @@ -39,7 +39,7 @@ config SYS_CLOCK_TICKS_PER_SEC default 32768 config BT_CTLR - default y if BOARD_NRF52_BSIM || BOARD_NRF5340BSIM_NRF5340_CPUNET || BOARD_NRF54L15BSIM_NRF54L15_CPUAPP + default y if BOARD_NRF52_BSIM || BOARD_NRF5340BSIM_NRF5340_CPUNET depends on BT config HEAP_MEM_POOL_ADD_SIZE_BOARD From 40674df12370b518b15ac9e0e207f029f7fd6418 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 110/825] Revert "[nrf fromtree] boards nrf54l15bsim: Set clock status as ok in DT" This reverts commit abf853900d7c8e92588fd7218adb3fe23918391b. --- boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts b/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts index 91c2233d70b..ec34448017e 100644 --- a/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts +++ b/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts @@ -59,6 +59,7 @@ /delete-node/ watchdog@109000; /delete-node/ gpio@10a000; /delete-node/ gpiote@10c000; + /delete-node/ clock@10e000; }; /delete-node/ spu@50003000; /delete-node/ gpiote@5000d000; @@ -98,7 +99,3 @@ /* This feature is not yet supported by the RADIO model */ /delete-property/ dfe-supported; }; - -&clock { - status = "okay"; -}; From 59c15c844b1c6ab1f03fe9857c332ef77761ff06 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 111/825] Revert "[nrf fromtree] boards nrf_bsim: Add NVIC_GetEnableIRQ()" This reverts commit ec0cad597b4b3ea8bdf13b7b945c713e3221511d. --- boards/native/nrf_bsim/common/cmsis/cmsis.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/boards/native/nrf_bsim/common/cmsis/cmsis.c b/boards/native/nrf_bsim/common/cmsis/cmsis.c index e80aea6b4ff..1694bc1da34 100644 --- a/boards/native/nrf_bsim/common/cmsis/cmsis.c +++ b/boards/native/nrf_bsim/common/cmsis/cmsis.c @@ -35,11 +35,6 @@ void NVIC_EnableIRQ(IRQn_Type IRQn) hw_irq_ctrl_enable_irq(CONFIG_NATIVE_SIMULATOR_MCU_N, IRQn); } -uint32_t NVIC_GetEnableIRQ(IRQn_Type IRQn) -{ - return hw_irq_ctrl_is_irq_enabled(CONFIG_NATIVE_SIMULATOR_MCU_N, IRQn); -} - void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) { hw_irq_ctrl_prio_set(CONFIG_NATIVE_SIMULATOR_MCU_N, IRQn, priority); From b2aabb335d3aa57b2f1b27bca48052c4991f82d8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 112/825] Revert "[nrf fromtree] boards nrf54l15bsim: Update docs as we now have RADIO" This reverts commit 5b5a7bb189e252dac6919d86e824921dd478b705. --- boards/native/nrf_bsim/doc/nrf54l15bsim.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/boards/native/nrf_bsim/doc/nrf54l15bsim.rst b/boards/native/nrf_bsim/doc/nrf54l15bsim.rst index bb113510c4a..702ff50f851 100644 --- a/boards/native/nrf_bsim/doc/nrf54l15bsim.rst +++ b/boards/native/nrf_bsim/doc/nrf54l15bsim.rst @@ -31,9 +31,8 @@ on the simulated nRF54L15 SOC. .. warning:: - This target is experimental, and even though it includes models of the RADIO, it does not yet - include models of the AAR, CCM, ECB or CLOCK peripherals, so the BLE and 802.15.4 stacks cannot - be run on it yet. + This target is experimental, and does not yet include models of the RADIO peripheral, + so the BLE and 802.15.4 stacks cannot be run on it yet. This boards include models of some of the nRF54L15 SOC peripherals: @@ -42,7 +41,6 @@ This boards include models of some of the nRF54L15 SOC peripherals: * FICR (Factory Information Configuration Registers) * GRTC (Global Real-time Counter) * PPIB (PPI Bridge) -* RADIO * RRAMC (Resistive RAM Controller) * RTC (Real Time Counter) * TEMP (Temperature sensor) From 83953f4e2128da49e76f4577b9daefd4f19613d6 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 113/825] Revert "[nrf fromtree] boards nrf54l15bsim//cpuapp: Don't remove RADIO in DT" This reverts commit 108f4ee79c5da7afc772195bed88889159d2f796. --- boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts b/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts index ec34448017e..ff4aef337f2 100644 --- a/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts +++ b/boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts @@ -33,6 +33,7 @@ /delete-node/ mailbox@0; /delete-node/ interrupt-controller@f0000000; /delete-node/ gpio@50400; + /delete-node/ radio@8a000; /delete-node/ i2c@c6000; /delete-node/ spi@c6000; /delete-node/ uart@c6000; @@ -94,8 +95,3 @@ &temp { status = "okay"; }; - -&radio { - /* This feature is not yet supported by the RADIO model */ - /delete-property/ dfe-supported; -}; From 16d4cc917d4ecdb17c46194f7058271af2b400eb Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 114/825] Revert "[nrf noup] snippets: Add snippet for the Zephyr Bluetooth Controller" This reverts commit fb6ca20a06ba31a3dc1b86d6986d48ad4a5760b0. --- snippets/bt-ll-sw-split/README.rst | 21 ------------------- snippets/bt-ll-sw-split/bt-ll-sw-split.conf | 3 --- .../bt-ll-sw-split/bt-ll-sw-split.overlay | 13 ------------ snippets/bt-ll-sw-split/snippet.yml | 4 ---- 4 files changed, 41 deletions(-) delete mode 100644 snippets/bt-ll-sw-split/README.rst delete mode 100644 snippets/bt-ll-sw-split/bt-ll-sw-split.conf delete mode 100644 snippets/bt-ll-sw-split/bt-ll-sw-split.overlay delete mode 100644 snippets/bt-ll-sw-split/snippet.yml diff --git a/snippets/bt-ll-sw-split/README.rst b/snippets/bt-ll-sw-split/README.rst deleted file mode 100644 index 490d45be36c..00000000000 --- a/snippets/bt-ll-sw-split/README.rst +++ /dev/null @@ -1,21 +0,0 @@ -.. _snippet-bt-ll-sw-split: - -Zephyr Bluetooth LE Controller (bt-ll-sw-split) -############################################### - -.. code-block:: console - - west build -S bt-ll-sw-split [...] - -Overview -******** - -This snippet changes the default Bluetooth controller to the Zephyr Bluetooth LE Controller. - -Requirements -************ - -Hardware support for: - -- :kconfig:option:`CONFIG_BT` -- :kconfig:option:`CONFIG_BT_CTLR` diff --git a/snippets/bt-ll-sw-split/bt-ll-sw-split.conf b/snippets/bt-ll-sw-split/bt-ll-sw-split.conf deleted file mode 100644 index f2dd622901b..00000000000 --- a/snippets/bt-ll-sw-split/bt-ll-sw-split.conf +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BT=y -CONFIG_BT_CTLR=y -CONFIG_BT_LL_SW_SPLIT=y diff --git a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay b/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay deleted file mode 100644 index a57a0e82ba6..00000000000 --- a/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay +++ /dev/null @@ -1,13 +0,0 @@ -&bt_hci_controller { - status = "okay"; -}; - -&bt_hci_sdc { - status = "disabled"; -}; - -/ { - chosen { - zephyr,bt-hci = &bt_hci_controller; - }; -}; diff --git a/snippets/bt-ll-sw-split/snippet.yml b/snippets/bt-ll-sw-split/snippet.yml deleted file mode 100644 index 27a7325dc7e..00000000000 --- a/snippets/bt-ll-sw-split/snippet.yml +++ /dev/null @@ -1,4 +0,0 @@ -name: bt-ll-sw-split -append: - EXTRA_CONF_FILE: bt-ll-sw-split.conf - EXTRA_DTC_OVERLAY_FILE: bt-ll-sw-split.overlay From 8c82ea32925da9f4eaf002240743e1d091643d85 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 115/825] Revert "[nrf fromtree] twister: Pass device flash timeout to pytest-harness." This reverts commit dc168866731bedc2d3d4fc2c640503a57004bcc4. --- .../src/twister_harness/device/hardware_adapter.py | 2 +- .../pytest-twister-harness/src/twister_harness/plugin.py | 9 ++------- .../src/twister_harness/twister_harness_config.py | 2 -- scripts/pylib/twister/twisterlib/harness.py | 3 --- 4 files changed, 3 insertions(+), 13 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 32fe611d747..98375873eb9 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 @@ -30,7 +30,7 @@ class HardwareAdapter(DeviceAdapter): def __init__(self, device_config: DeviceConfig) -> None: super().__init__(device_config) - self._flashing_timeout: float = device_config.flash_timeout + self._flashing_timeout: float = self.base_timeout self._serial_connection: serial.Serial | None = None self._serial_pty_proc: subprocess.Popen | None = None self._serial_buffer: bytearray = bytearray() diff --git a/scripts/pylib/pytest-twister-harness/src/twister_harness/plugin.py b/scripts/pylib/pytest-twister-harness/src/twister_harness/plugin.py index ef8a1fb6dc1..e484cb8bb43 100644 --- a/scripts/pylib/pytest-twister-harness/src/twister_harness/plugin.py +++ b/scripts/pylib/pytest-twister-harness/src/twister_harness/plugin.py @@ -36,13 +36,8 @@ def pytest_addoption(parser: pytest.Parser): type=float, default=60.0, help='Set base timeout (in seconds) used during monitoring if some ' - 'operations are finished in a finite amount of time.' - ) - twister_harness_group.addoption( - '--flash-timeout', - type=float, - default=60.0, - help='Set timeout for device flashing (in seconds).' + 'operations are finished in a finite amount of time (e.g. waiting ' + 'for flashing).' ) twister_harness_group.addoption( '--build-dir', diff --git a/scripts/pylib/pytest-twister-harness/src/twister_harness/twister_harness_config.py b/scripts/pylib/pytest-twister-harness/src/twister_harness/twister_harness_config.py index c635f62973a..a4b0b749777 100644 --- a/scripts/pylib/pytest-twister-harness/src/twister_harness/twister_harness_config.py +++ b/scripts/pylib/pytest-twister-harness/src/twister_harness/twister_harness_config.py @@ -19,7 +19,6 @@ class DeviceConfig: type: str build_dir: Path base_timeout: float = 60.0 # [s] - flash_timeout: float = 60.0 # [s] platform: str = '' serial: str = '' baud: int = 115200 @@ -66,7 +65,6 @@ def create(cls, config: pytest.Config) -> TwisterHarnessConfig: type=config.option.device_type, build_dir=_cast_to_path(config.option.build_dir), base_timeout=config.option.base_timeout, - flash_timeout=config.option.flash_timeout, platform=config.option.platform, serial=config.option.device_serial, baud=config.option.device_serial_baud, diff --git a/scripts/pylib/twister/twisterlib/harness.py b/scripts/pylib/twister/twisterlib/harness.py index 6cc46b98c3b..d11d174a1bb 100644 --- a/scripts/pylib/twister/twisterlib/harness.py +++ b/scripts/pylib/twister/twisterlib/harness.py @@ -386,9 +386,6 @@ def _generate_parameters_for_hardware(self, handler: Handler): f'--device-serial-baud={hardware.baud}' ]) - if hardware.flash_timeout: - command.append(f'--flash-timeout={hardware.flash_timeout}') - options = handler.options if runner := hardware.runner or options.west_runner: command.append(f'--runner={runner}') From d35468b370db9cb2e310f4732d3e02d28a16f5bb Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 116/825] Revert "[nrf noup] samples: bluetooth: hci_pwr_ctrl: Remove child/parent configuration" This reverts commit 21c97d07da26177a3d1cc000f523e3fe73569d63. --- samples/bluetooth/hci_pwr_ctrl/child_image/hci_rpmsg.conf | 1 + 1 file changed, 1 insertion(+) create mode 100644 samples/bluetooth/hci_pwr_ctrl/child_image/hci_rpmsg.conf diff --git a/samples/bluetooth/hci_pwr_ctrl/child_image/hci_rpmsg.conf b/samples/bluetooth/hci_pwr_ctrl/child_image/hci_rpmsg.conf new file mode 100644 index 00000000000..e6749ae6399 --- /dev/null +++ b/samples/bluetooth/hci_pwr_ctrl/child_image/hci_rpmsg.conf @@ -0,0 +1 @@ +CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y From 76cbd4cb87a50e6b530bf2e631ff5a75f94f9f1c Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 117/825] Revert "[nrf noup] samples: mgmt: mcumgr: Remove child/parent configuration" This reverts commit cfd7516f27e41b5df67a00f8ac7c7272eb95962b. --- .../mgmt/mcumgr/smp_svr/child_image/hci_rpmsg.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 samples/subsys/mgmt/mcumgr/smp_svr/child_image/hci_rpmsg.conf diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/child_image/hci_rpmsg.conf b/samples/subsys/mgmt/mcumgr/smp_svr/child_image/hci_rpmsg.conf new file mode 100644 index 00000000000..98260877332 --- /dev/null +++ b/samples/subsys/mgmt/mcumgr/smp_svr/child_image/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 53ea174171c63a8f1ee253439df68a71e67676e8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 118/825] Revert "[nrf fromtree] modules: hal_nordic: Support EGU130 driver instance" This reverts commit 7f07a706c4e717da04f97d14f6b6ab2e0b632eae. --- dts/common/nordic/nrf54h20.dtsi | 7 ------- modules/hal_nordic/nrfx/Kconfig | 5 ----- modules/hal_nordic/nrfx/nrfx_config.h | 3 --- soc/nordic/validate_base_addresses.c | 1 - 4 files changed, 16 deletions(-) diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index a5e086112ec..574fd375c3f 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -651,13 +651,6 @@ clocks = <&lfclk>; }; - egu130: egu@92d000 { - compatible = "nordic,nrf-egu"; - reg = <0x92d000 0x1000>; - status = "disabled"; - interrupts = <301 NRF_DEFAULT_IRQ_PRIORITY>; - }; - gpiote130: gpiote@934000 { compatible = "nordic,nrf-gpiote"; reg = <0x934000 0x1000>; diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 6f3bd8a984e..fdf7745970d 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -81,11 +81,6 @@ config NRFX_EGU020 depends on $(dt_nodelabel_has_compat,egu020,$(DT_COMPAT_NORDIC_NRF_EGU)) select NRFX_EGU -config NRFX_EGU130 - bool "EGU130 driver instance" - depends on $(dt_nodelabel_has_compat,egu130,$(DT_COMPAT_NORDIC_NRF_EGU)) - select NRFX_EGU - config NRFX_GPIOTE bool diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index c2e558ded24..930caa21f1f 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -118,9 +118,6 @@ #ifdef CONFIG_NRFX_EGU020 #define NRFX_EGU020_ENABLED 1 #endif -#ifdef CONFIG_NRFX_EGU130 -#define NRFX_EGU130_ENABLED 1 -#endif #ifdef CONFIG_NRFX_GRTC #define NRFX_GRTC_ENABLED 1 diff --git a/soc/nordic/validate_base_addresses.c b/soc/nordic/validate_base_addresses.c index cb398b8783d..4fca3501e27 100644 --- a/soc/nordic/validate_base_addresses.c +++ b/soc/nordic/validate_base_addresses.c @@ -173,7 +173,6 @@ CHECK_DT_REG(egu5, NRF_EGU5); CHECK_DT_REG(egu10, NRF_EGU10); CHECK_DT_REG(egu20, NRF_EGU20); CHECK_DT_REG(egu020, NRF_RADIOCORE_EGU020); -CHECK_DT_REG(egu130, NRF_EGU130); CHECK_DT_REG(ficr, NRF_FICR); CHECK_DT_REG(flash_controller, NRF_NVMC); CHECK_DT_REG(gpio0, NRF_P0); From ca21ca1181d048808403b45af069e3f24b2b4800 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 119/825] Revert "[nrf fromtree] modules: hal_nordic: Support nRF54L15 EGU driver instances" This reverts commit 17e06d740e33ec10abbff2eaa644f8328d48afcc. --- modules/hal_nordic/nrfx/Kconfig | 10 ---------- modules/hal_nordic/nrfx/nrfx_config.h | 6 ------ 2 files changed, 16 deletions(-) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index fdf7745970d..114988a945a 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -66,16 +66,6 @@ config NRFX_EGU5 depends on $(dt_nodelabel_has_compat,egu5,$(DT_COMPAT_NORDIC_NRF_EGU)) select NRFX_EGU -config NRFX_EGU10 - bool "EGU10 driver instance" - depends on $(dt_nodelabel_has_compat,egu10,$(DT_COMPAT_NORDIC_NRF_EGU)) - select NRFX_EGU - -config NRFX_EGU20 - bool "EGU20 driver instance" - depends on $(dt_nodelabel_has_compat,egu20,$(DT_COMPAT_NORDIC_NRF_EGU)) - select NRFX_EGU - config NRFX_EGU020 bool "EGU020 driver instance" depends on $(dt_nodelabel_has_compat,egu020,$(DT_COMPAT_NORDIC_NRF_EGU)) diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index 930caa21f1f..66b9bd99399 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -109,12 +109,6 @@ #ifdef CONFIG_NRFX_EGU5 #define NRFX_EGU5_ENABLED 1 #endif -#ifdef CONFIG_NRFX_EGU10 -#define NRFX_EGU10_ENABLED 1 -#endif -#ifdef CONFIG_NRFX_EGU20 -#define NRFX_EGU20_ENABLED 1 -#endif #ifdef CONFIG_NRFX_EGU020 #define NRFX_EGU020_ENABLED 1 #endif From 1f099f8451f5c308aae6fe89c9d211353d5f4cfc Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 120/825] Revert "[nrf fromtree] manifest: Update nRF hw models to latest" This reverts commit 7b78fdc0992cb177e955e44bd0cd0ae069e22d96. --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index e94967ddad1..d53288160be 100644 --- a/west.yml +++ b/west.yml @@ -295,7 +295,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: 6e70c2dc5d4c67c4da5913b2969c0774b27f0cd0 + revision: 3ede17158a9fe85c160e0384c0ad0306e24ee47e path: modules/bsim_hw_models/nrf_hw_models - name: open-amp revision: da78aea63159771956fe0c9263f2e6985b66e9d5 From a8ba0bda8a4e24cb99ff93f4c83380834e6b6b0c Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 121/825] Revert "[nrf fromtree] manifest: Update EDTT to latest version" This reverts commit afbc294c17b884588c34af6a4ba77c644b6f85bf. --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index d53288160be..2b4fc9fa1cb 100644 --- a/west.yml +++ b/west.yml @@ -127,7 +127,7 @@ manifest: revision: 0c8669d81381ccf3b1a01d699f3b68b50134a99f path: modules/lib/cmsis-nn - name: edtt - revision: b9ca3c7030518f07b7937dacf970d37a47865a76 + revision: 8d7b543d4d2f2be0f78481e4e1d8d73a88024803 path: tools/edtt groups: - tools From 472285664d596ec29f4a451ee3ed1d8e2f47dfc5 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 122/825] Revert "[nrf fromtree] manifest: Update EDTT to latest" This reverts commit e400f0cb23993e25393a89b492f8c891feb46fe8. --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 2b4fc9fa1cb..3e705e15ea6 100644 --- a/west.yml +++ b/west.yml @@ -127,7 +127,7 @@ manifest: revision: 0c8669d81381ccf3b1a01d699f3b68b50134a99f path: modules/lib/cmsis-nn - name: edtt - revision: 8d7b543d4d2f2be0f78481e4e1d8d73a88024803 + revision: 64e5105ad82390164fb73fc654be3f73a608209a path: tools/edtt groups: - tools From 57cf50dd09c57dc8ac069437ebb11595f7d9ecb4 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:55 +0200 Subject: [PATCH 123/825] Revert "[nrf fromtree] manifest: Update bsim to version v2.3" This reverts commit 6e43e9b9ce2f65fededd62ff747e49a5a0275b94. --- west.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/west.yml b/west.yml index 3e705e15ea6..fab901ae399 100644 --- a/west.yml +++ b/west.yml @@ -34,7 +34,7 @@ manifest: path: modules/lib/acpica - name: bsim repo-path: babblesim-manifest - revision: 9ee22c707970f6621adba0375841c0a609e24628 + revision: 9351ae1ad44864a49c351f9704f65f43046abeb0 path: tools/bsim groups: - babblesim @@ -42,14 +42,14 @@ manifest: remote: babblesim repo-path: base path: tools/bsim/components - revision: a3dff9a57f334fb25daa9625841cd64cbfe56681 + revision: 4bd907be0b2abec3b31a23fd8ca98db2a07209d2 groups: - babblesim - name: babblesim_ext_2G4_libPhyComv1 remote: babblesim repo-path: ext_2G4_libPhyComv1 path: tools/bsim/components/ext_2G4_libPhyComv1 - revision: aa4951317cc7d84f24152ea38ac9ac21e6d78a76 + revision: 93f5eba512c438b0c9ebc1b1a947517c865b3643 groups: - babblesim - name: babblesim_ext_2G4_phy_v1 @@ -84,7 +84,7 @@ manifest: remote: babblesim repo-path: ext_2G4_modem_BLE_simple path: tools/bsim/components/ext_2G4_modem_BLE_simple - revision: 4d2379de510684cd4b1c3bbbb09bce7b5a20bc1f + revision: a38d2d24b04a6f970a225d1316047256ebf5a539 groups: - babblesim - name: babblesim_ext_2G4_device_burst_interferer @@ -112,7 +112,7 @@ manifest: remote: babblesim repo-path: ext_libCryptov1 path: tools/bsim/components/ext_libCryptov1 - revision: 236309584c90be32ef12848077bd6de54e9f4deb + revision: eed6d7038e839153e340bd333bc43541cb90ba64 groups: - babblesim - name: cmsis From 31e97c5f252f7d5abcdb8aca4c96512b709eb652 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 124/825] Revert "[nrf fromtree] manifest: Update bsim to version v2.2.1" This reverts commit 6a07938bcf89c63a76e895800a334ca49e314da1. --- west.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/west.yml b/west.yml index fab901ae399..643cb862e52 100644 --- a/west.yml +++ b/west.yml @@ -34,7 +34,7 @@ manifest: path: modules/lib/acpica - name: bsim repo-path: babblesim-manifest - revision: 9351ae1ad44864a49c351f9704f65f43046abeb0 + revision: 68f6282c6a7f54641b75f5f9fc953c85e272a983 path: tools/bsim groups: - babblesim @@ -56,7 +56,7 @@ manifest: remote: babblesim repo-path: ext_2G4_phy_v1 path: tools/bsim/components/ext_2G4_phy_v1 - revision: 04eeb3c3794444122fbeeb3715f4233b0b50cfbb + revision: d8302b8d51409b9e717a1a0ba6b443d3b5552a6c groups: - babblesim - name: babblesim_ext_2G4_channel_NtNcable From dd59c9e94ae6e77d0c820ad6c5ec70b38dbb47a4 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 125/825] Revert "[nrf fromtree] twister: Fix TypeError at get_installed_packages" This reverts commit af17fd81e2c823fb38d9487fe8b32051376e7a49. --- scripts/pylib/twister/twisterlib/environment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/environment.py b/scripts/pylib/twister/twisterlib/environment.py index c778623535f..2d1899f7199 100644 --- a/scripts/pylib/twister/twisterlib/environment.py +++ b/scripts/pylib/twister/twisterlib/environment.py @@ -16,7 +16,7 @@ from datetime import datetime, timezone from importlib import metadata from pathlib import Path -from typing import Generator, List +from typing import Generator from twisterlib.coverage import supported_coverage_formats @@ -49,7 +49,7 @@ def _get_installed_packages() -> Generator[str, None, None]: yield dist.metadata['Name'] -installed_packages: List[str] = list(_get_installed_packages()) +installed_packages: list[str] = list(_get_installed_packages()) PYTEST_PLUGIN_INSTALLED = 'pytest-twister-harness' in installed_packages From 300db70021c40f555817f7af534564e0424e6c75 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 126/825] Revert "[nrf fromtree] twister: Fix failing tests on CI with Python 3.12" This reverts commit fba7deda5c30a56fec455acb66e66f43bf295c99. --- .../pylib/twister/twisterlib/environment.py | 27 ++++++------------- scripts/pylib/twister/twisterlib/harness.py | 1 - scripts/pylib/twister/twisterlib/testplan.py | 2 -- 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/environment.py b/scripts/pylib/twister/twisterlib/environment.py index 2d1899f7199..85b7cdb371e 100644 --- a/scripts/pylib/twister/twisterlib/environment.py +++ b/scripts/pylib/twister/twisterlib/environment.py @@ -5,19 +5,17 @@ # Copyright 2022 NXP # SPDX-License-Identifier: Apache-2.0 -import argparse +import os +import pkg_resources +import sys +from pathlib import Path import json import logging -import os -import re -import shutil import subprocess -import sys +import shutil +import re +import argparse from datetime import datetime, timezone -from importlib import metadata -from pathlib import Path -from typing import Generator - from twisterlib.coverage import supported_coverage_formats logger = logging.getLogger('twister') @@ -42,22 +40,13 @@ # Note "normalization" is different from canonicalization, see os.path. canonical_zephyr_base = os.path.realpath(ZEPHYR_BASE) - -def _get_installed_packages() -> Generator[str, None, None]: - """Return list of installed python packages.""" - for dist in metadata.distributions(): - yield dist.metadata['Name'] - - -installed_packages: list[str] = list(_get_installed_packages()) +installed_packages = [pkg.project_name for pkg in pkg_resources.working_set] # pylint: disable=not-an-iterable PYTEST_PLUGIN_INSTALLED = 'pytest-twister-harness' in installed_packages - def norm_path(astring): newstring = os.path.normpath(astring).replace(os.sep, '/') return newstring - def add_parse_arguments(parser = None): if parser is None: parser = argparse.ArgumentParser( diff --git a/scripts/pylib/twister/twisterlib/harness.py b/scripts/pylib/twister/twisterlib/harness.py index d11d174a1bb..e685d55e5af 100644 --- a/scripts/pylib/twister/twisterlib/harness.py +++ b/scripts/pylib/twister/twisterlib/harness.py @@ -624,7 +624,6 @@ def _check_result(self, line): class Test(Harness): - __test__ = False # for pytest to skip this class when collects tests RUN_PASSED = "PROJECT EXECUTION SUCCESSFUL" RUN_FAILED = "PROJECT EXECUTION FAILED" test_suite_start_pattern = r"Running TESTSUITE (?P.*)" diff --git a/scripts/pylib/twister/twisterlib/testplan.py b/scripts/pylib/twister/twisterlib/testplan.py index 2e0e2d20edb..83c5d6b06fd 100755 --- a/scripts/pylib/twister/twisterlib/testplan.py +++ b/scripts/pylib/twister/twisterlib/testplan.py @@ -77,9 +77,7 @@ class TestLevel: levels = [] scenarios = [] - class TestPlan: - __test__ = False # for pytest to skip this class when collects tests config_re = re.compile('(CONFIG_[A-Za-z0-9_]+)[=]\"?([^\"]*)\"?$') dt_re = re.compile('([A-Za-z0-9_]+)[=]\"?([^\"]*)\"?$') From 73d9cba76fb450748151bd2e9ad629f1a46248c3 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 127/825] Revert "[nrf fromtree] twister: scripts: Split lines before processing" This reverts commit 79fc1effa282dd8e2512e63a52045a6d3e332849. --- scripts/pylib/twister/twisterlib/handlers.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/handlers.py b/scripts/pylib/twister/twisterlib/handlers.py index e14c86719a7..97e79955998 100755 --- a/scripts/pylib/twister/twisterlib/handlers.py +++ b/scripts/pylib/twister/twisterlib/handlers.py @@ -421,13 +421,12 @@ def monitor_serial(self, ser, halt_event, harness): # Just because ser_fileno has data doesn't mean an entire line # is available yet. if serial_line: - # can be more lines in serial_line so split them before handling - for sl in serial_line.decode('utf-8', 'ignore').splitlines(): - log_out_fp.write(strip_ansi_sequences(sl).encode('utf-8')) - log_out_fp.flush() - if sl := sl.strip(): - logger.debug("DEVICE: {0}".format(sl)) - harness.handle(sl) + sl = serial_line.decode('utf-8', 'ignore').lstrip() + logger.debug("DEVICE: {0}".format(sl.rstrip())) + + log_out_fp.write(strip_ansi_sequences(sl).encode('utf-8')) + log_out_fp.flush() + harness.handle(sl.rstrip()) if harness.state: if not harness.capture_coverage: From 36ab8585991126edc615604df15321b7ef78c863 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 128/825] Revert "[nrf fromtree] drivers: usb: common: nrf_usbd_common: Handle USB SoF IRQ first" This reverts commit a3247acca3941403af8404ee6cb20f96aa9c72e5. --- .../common/nrf_usbd_common/nrf_usbd_common.c | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.c b/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.c index fcd5cff5ef6..3db193ee2f0 100644 --- a/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.c +++ b/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.c @@ -1029,16 +1029,6 @@ void nrf_usbd_common_irq_handler(void) volatile uint32_t *dma_endevent; uint32_t epdatastatus = 0; - /* Always check and clear SOF but call handler only if SOF interrupt - * is actually enabled. - */ - if (NRF_USBD->EVENTS_SOF) { - NRF_USBD->EVENTS_SOF = 0; - if (NRF_USBD->INTENSET & USBD_INTEN_SOF_Msk) { - ev_sof_handler(); - } - } - /* Clear EPDATA event and only then get and clear EPDATASTATUS to make * sure we don't miss any event. */ @@ -1076,6 +1066,16 @@ void nrf_usbd_common_irq_handler(void) ev_usbreset_handler(); } + /* Always check and clear SOF but call handler only if SOF interrupt + * is actually enabled. + */ + if (NRF_USBD->EVENTS_SOF) { + NRF_USBD->EVENTS_SOF = 0; + if (NRF_USBD->INTENSET & USBD_INTEN_SOF_Msk) { + ev_sof_handler(); + } + } + if (NRF_USBD->EVENTS_USBEVENT) { NRF_USBD->EVENTS_USBEVENT = 0; ev_usbevent_handler(); From 456857f594e93fe656be132f1b096f45c32f8bc8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 129/825] Revert "[nrf fromlist] soc: nordic: nrf54l15: add missing include" This reverts commit f8ab2bf6cc0a76cb8e0e50eff031df8b10c9a0d7. --- soc/nordic/nrf54l/soc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/soc/nordic/nrf54l/soc.c b/soc/nordic/nrf54l/soc.c index c23374e6784..52ec63f9010 100644 --- a/soc/nordic/nrf54l/soc.c +++ b/soc/nordic/nrf54l/soc.c @@ -20,7 +20,6 @@ #include #include #include -#include #ifndef __NRF_TFM__ #include From 9f6de3e8134af3607895278cad74ae8ac0c4c430 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 130/825] Revert "[nrf fromtree] soc: nordic: Move DCDC configuration to DT for nRF54L15" This reverts commit 40160895f5baf330ff142deb22886020bf879f1b. --- boards/nordic/nrf54l15pdk/Kconfig | 9 +++++++++ .../nrf54l15pdk/nrf54l15_cpuapp_common.dtsi | 9 --------- .../regulator/nordic,nrf54l-regulators.yaml | 12 ------------ dts/common/nordic/nrf54l15.dtsi | 17 ----------------- soc/nordic/nrf54l/Kconfig | 5 +++++ soc/nordic/nrf54l/soc.c | 6 +++--- 6 files changed, 17 insertions(+), 41 deletions(-) delete mode 100644 dts/bindings/regulator/nordic,nrf54l-regulators.yaml diff --git a/boards/nordic/nrf54l15pdk/Kconfig b/boards/nordic/nrf54l15pdk/Kconfig index 8c937c8c890..841c93c51f0 100644 --- a/boards/nordic/nrf54l15pdk/Kconfig +++ b/boards/nordic/nrf54l15pdk/Kconfig @@ -3,6 +3,15 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 +if BOARD_NRF54L15PDK_NRF54L15_CPUAPP + +config BOARD_ENABLE_DCDC + bool "DCDC mode" + select SOC_NRF54L_VREG_MAIN_DCDC + default y + +endif # BOARD_NRF54L15PDK_NRF54L15_CPUAPP + if BOARD_NRF54L15PDK_NRF54L15_CPUAPP_NS config NRF_MPC_REGION_SIZE diff --git a/boards/nordic/nrf54l15pdk/nrf54l15_cpuapp_common.dtsi b/boards/nordic/nrf54l15pdk/nrf54l15_cpuapp_common.dtsi index d4532f90362..592ba48d2a8 100644 --- a/boards/nordic/nrf54l15pdk/nrf54l15_cpuapp_common.dtsi +++ b/boards/nordic/nrf54l15pdk/nrf54l15_cpuapp_common.dtsi @@ -38,15 +38,6 @@ load-capacitance-femtofarad = <15000>; }; -®ulators { - status = "okay"; -}; - -&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 */ diff --git a/dts/bindings/regulator/nordic,nrf54l-regulators.yaml b/dts/bindings/regulator/nordic,nrf54l-regulators.yaml deleted file mode 100644 index 03ca0d946b2..00000000000 --- a/dts/bindings/regulator/nordic,nrf54l-regulators.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic REGULATORS (voltage regulators control module) on nRF54L. - -compatible: "nordic,nrf54l-regulators" - -include: base.yaml - -properties: - reg: - required: true diff --git a/dts/common/nordic/nrf54l15.dtsi b/dts/common/nordic/nrf54l15.dtsi index 3681a90cc48..39a3d70e2c1 100644 --- a/dts/common/nordic/nrf54l15.dtsi +++ b/dts/common/nordic/nrf54l15.dtsi @@ -6,7 +6,6 @@ #include #include -#include /delete-node/ &sw_pwm; @@ -592,22 +591,6 @@ interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; 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@5004b000 { diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index 2d0283bc245..d7d49c70832 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -75,6 +75,11 @@ 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_VREG_MAIN_DCDC + bool "NRF54L DC/DC converter." + help + To enable, an inductor must be connected to the DC/DC converter pin. + config SOC_NRF54L_NORMAL_VOLTAGE_MODE bool "NRF54L Normal Voltage Mode." diff --git a/soc/nordic/nrf54l/soc.c b/soc/nordic/nrf54l/soc.c index 52ec63f9010..95d3debbce1 100644 --- a/soc/nordic/nrf54l/soc.c +++ b/soc/nordic/nrf54l/soc.c @@ -149,9 +149,9 @@ static inline void power_and_clock_configuration(void) nrf_power_task_trigger(NRF_POWER, NRF_POWER_TASK_CONSTLAT); } -#if (DT_PROP(DT_NODELABEL(vregmain), regulator_initial_mode) == NRF5X_REG_MODE_DCDC) - nrf_regulators_vreg_enable_set(NRF_REGULATORS, NRF_REGULATORS_VREG_MAIN, true); -#endif + if (IS_ENABLED(CONFIG_SOC_NRF54L_VREG_MAIN_DCDC)) { + nrf_regulators_vreg_enable_set(NRF_REGULATORS, NRF_REGULATORS_VREG_MAIN, true); + } if (IS_ENABLED(CONFIG_SOC_NRF54L_NORMAL_VOLTAGE_MODE)) { nrf_regulators_vreg_enable_set(NRF_REGULATORS, NRF_REGULATORS_VREG_MEDIUM, false); From 8e7eebe282a568f0293998567b4e7afb95603923 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 131/825] Revert "[nrf fromtree] dts: boards: Add nRF54L15 ENGA configuration" This reverts commit 9078923bcb27be0e15b84a6e1630414852757058. --- .../nrf54l15pdk/nrf54l15_cpuapp_common.dtsi | 2 +- .../nrf54l15pdk_nrf54l15_cpuflpr.dts | 2 +- dts/arm/nordic/nrf54l15_cpuapp.dtsi | 4 +-- dts/arm/nordic/nrf54l15_enga_cpuapp.dtsi | 18 ------------- dts/riscv/nordic/nrf54l15_cpuflpr.dtsi | 18 ++++++------- dts/riscv/nordic/nrf54l15_enga_cpuflpr.dtsi | 25 ------------------- 6 files changed, 13 insertions(+), 56 deletions(-) delete mode 100644 dts/arm/nordic/nrf54l15_enga_cpuapp.dtsi delete mode 100644 dts/riscv/nordic/nrf54l15_enga_cpuflpr.dtsi diff --git a/boards/nordic/nrf54l15pdk/nrf54l15_cpuapp_common.dtsi b/boards/nordic/nrf54l15pdk/nrf54l15_cpuapp_common.dtsi index 592ba48d2a8..2fa2ec36428 100644 --- a/boards/nordic/nrf54l15pdk/nrf54l15_cpuapp_common.dtsi +++ b/boards/nordic/nrf54l15pdk/nrf54l15_cpuapp_common.dtsi @@ -6,7 +6,7 @@ /* This file is common to the secure and non-secure domain */ -#include +#include #include "nrf54l15pdk_nrf54l15-common.dtsi" / { diff --git a/boards/nordic/nrf54l15pdk/nrf54l15pdk_nrf54l15_cpuflpr.dts b/boards/nordic/nrf54l15pdk/nrf54l15pdk_nrf54l15_cpuflpr.dts index 2b80a45c4e1..e7ce7b43f7a 100644 --- a/boards/nordic/nrf54l15pdk/nrf54l15pdk_nrf54l15_cpuflpr.dts +++ b/boards/nordic/nrf54l15pdk/nrf54l15pdk_nrf54l15_cpuflpr.dts @@ -5,7 +5,7 @@ */ /dts-v1/; -#include +#include #include "nrf54l15pdk_nrf54l15-common.dtsi" / { diff --git a/dts/arm/nordic/nrf54l15_cpuapp.dtsi b/dts/arm/nordic/nrf54l15_cpuapp.dtsi index 707772b309c..bcc09da2556 100644 --- a/dts/arm/nordic/nrf54l15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l15_cpuapp.dtsi @@ -45,7 +45,7 @@ nvic: &cpuapp_nvic {}; interrupts = <76 NRF_DEFAULT_IRQ_PRIORITY>; #mbox-cells = <1>; nordic,events = <1>; - nordic,events-mask = <0x00100000>; + nordic,events-mask = <0x00008000>; }; cpuapp_vevif_tx: mailbox@0 { @@ -53,7 +53,7 @@ nvic: &cpuapp_nvic {}; reg = <0x0 0x1000>; #mbox-cells = <1>; nordic,tasks = <7>; - nordic,tasks-mask = <0x007f0000>; + nordic,tasks-mask = <0x0003f800>; status = "disabled"; }; }; diff --git a/dts/arm/nordic/nrf54l15_enga_cpuapp.dtsi b/dts/arm/nordic/nrf54l15_enga_cpuapp.dtsi deleted file mode 100644 index 0d62590839c..00000000000 --- a/dts/arm/nordic/nrf54l15_enga_cpuapp.dtsi +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -/delete-node/ &pdm20; -/delete-node/ &pdm21; - -&cpuapp_vevif_rx { - nordic,events-mask = <0x00008000>; -}; - -&cpuapp_vevif_tx { - nordic,tasks-mask = <0x0003f800>; -}; diff --git a/dts/riscv/nordic/nrf54l15_cpuflpr.dtsi b/dts/riscv/nordic/nrf54l15_cpuflpr.dtsi index fefa43b76c0..0e4437a1884 100644 --- a/dts/riscv/nordic/nrf54l15_cpuflpr.dtsi +++ b/dts/riscv/nordic/nrf54l15_cpuflpr.dtsi @@ -27,16 +27,16 @@ clic: &cpuflpr_clic {}; 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>; + interrupts = <11 NRF_DEFAULT_IRQ_PRIORITY>, + <12 NRF_DEFAULT_IRQ_PRIORITY>, + <13 NRF_DEFAULT_IRQ_PRIORITY>, + <14 NRF_DEFAULT_IRQ_PRIORITY>, + <15 NRF_DEFAULT_IRQ_PRIORITY>, + <16 NRF_DEFAULT_IRQ_PRIORITY>, + <17 NRF_DEFAULT_IRQ_PRIORITY>; #mbox-cells = <1>; nordic,tasks = <7>; - nordic,tasks-mask = <0x007f0000>; + nordic,tasks-mask = <0x0003f800>; }; }; @@ -45,7 +45,7 @@ clic: &cpuflpr_clic {}; compatible = "nordic,nrf-vevif-event-tx"; #mbox-cells = <1>; nordic,events = <1>; - nordic,events-mask = <0x00100000>; + nordic,events-mask = <0x00008000>; status = "disabled"; }; }; diff --git a/dts/riscv/nordic/nrf54l15_enga_cpuflpr.dtsi b/dts/riscv/nordic/nrf54l15_enga_cpuflpr.dtsi deleted file mode 100644 index 3f5e37ff405..00000000000 --- a/dts/riscv/nordic/nrf54l15_enga_cpuflpr.dtsi +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include - -/delete-node/ &pdm20; -/delete-node/ &pdm21; - -&cpuflpr_vevif_rx { - nordic,tasks-mask = <0x0003f800>; - interrupts = <11 NRF_DEFAULT_IRQ_PRIORITY>, - <12 NRF_DEFAULT_IRQ_PRIORITY>, - <13 NRF_DEFAULT_IRQ_PRIORITY>, - <14 NRF_DEFAULT_IRQ_PRIORITY>, - <15 NRF_DEFAULT_IRQ_PRIORITY>, - <16 NRF_DEFAULT_IRQ_PRIORITY>, - <17 NRF_DEFAULT_IRQ_PRIORITY>; -}; - -&cpuflpr_vevif_tx { - nordic,events-mask = <0x00008000>; -}; From 7b428f14ccc1692c5a61d6d6f669a29c091ea362 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 132/825] Revert "[nrf fromtree] tests: kernel: Add support for FLPR core in nRF54L15" This reverts commit d9695376103b5acbf4128e7f2bf1a8e76875768a. --- 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 1650a7b77ec..bba30c738a8 100644 --- a/tests/kernel/interrupt/src/nested_irq.c +++ b/tests/kernel/interrupt/src/nested_irq.c @@ -56,7 +56,7 @@ */ #define IRQ0_PRIO IRQ_DEFAULT_PRIORITY #define IRQ1_PRIO 0x0 -#elif defined(CONFIG_SOC_NRF54L15_ENGA_CPUFLPR) || defined(CONFIG_SOC_NRF54L15_CPUFLPR) +#elif defined(CONFIG_SOC_NRF54L15_ENGA_CPUFLPR) #define IRQ0_LINE 16 #define IRQ1_LINE 17 From 5b3a9f33c4b10455e1f10724e8abdc40683fd44a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 133/825] Revert "[nrf fromtree] samples: drivers: mbox: Update mbox sample to work with nRF54L15" This reverts commit 4b390eb305119990b3a5b61b063112575b82c856. --- samples/drivers/mbox/CMakeLists.txt | 3 +- samples/drivers/mbox/Kconfig.sysbuild | 1 - .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 20 --------- samples/drivers/mbox/remote/CMakeLists.txt | 3 +- .../nrf54l15dk_nrf54l15_cpuflpr.overlay | 24 ----------- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 29 ------------- snippets/nordic-flpr-xip/snippet.yml | 3 -- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 43 ------------------- snippets/nordic-flpr/snippet.yml | 3 -- 9 files changed, 2 insertions(+), 127 deletions(-) delete mode 100644 samples/drivers/mbox/boards/nrf54l15dk_nrf54l15_cpuapp.overlay delete mode 100644 samples/drivers/mbox/remote/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay delete mode 100644 snippets/nordic-flpr-xip/boards/nrf54l15dk_nrf54l15_cpuapp.overlay delete mode 100644 snippets/nordic-flpr/boards/nrf54l15dk_nrf54l15_cpuapp.overlay diff --git a/samples/drivers/mbox/CMakeLists.txt b/samples/drivers/mbox/CMakeLists.txt index fb57d153eac..5e2a955036d 100644 --- a/samples/drivers/mbox/CMakeLists.txt +++ b/samples/drivers/mbox/CMakeLists.txt @@ -19,8 +19,7 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP OR CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0 OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD OR - CONFIG_BOARD_NRF54L15PDK_NRF54L15_CPUAPP OR - CONFIG_BOARD_NRF54L15DK_NRF54L15_CPUAPP) + CONFIG_BOARD_NRF54L15PDK_NRF54L15_CPUAPP) message(STATUS "${BOARD}${BOARD_QUALIFIERS} compile as Main in this sample") else() message(FATAL_ERROR "${BOARD}${BOARD_QUALIFIERS} is not supported for this sample") diff --git a/samples/drivers/mbox/Kconfig.sysbuild b/samples/drivers/mbox/Kconfig.sysbuild index 311aa8fcf2a..77cda9c3365 100644 --- a/samples/drivers/mbox/Kconfig.sysbuild +++ b/samples/drivers/mbox/Kconfig.sysbuild @@ -17,4 +17,3 @@ string default "nrf54h20dk/nrf54h20/cpuppr" if "$(BOARD)${BOARD_QUALIFIERS}" = "nrf54h20dk/nrf54h20/cpuapp" default "nrf54h20dk/nrf54h20/cpuapp" if "$(BOARD)${BOARD_QUALIFIERS}" = "nrf54h20dk/nrf54h20/cpurad" default "nrf54l15pdk/nrf54l15/cpuflpr" if $(BOARD) = "nrf54l15pdk" - default "nrf54l15dk/nrf54l15/cpuflpr" if $(BOARD) = "nrf54l15dk" diff --git a/samples/drivers/mbox/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/samples/drivers/mbox/boards/nrf54l15dk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 55e736f57b4..00000000000 --- a/samples/drivers/mbox/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2024 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 4516227ec61..1a5d8fced94 100644 --- a/samples/drivers/mbox/remote/CMakeLists.txt +++ b/samples/drivers/mbox/remote/CMakeLists.txt @@ -18,8 +18,7 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUNET OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUPPR OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR CONFIG_BOARD_NRF54L15PDK_NRF54L15_CPUFLPR OR - CONFIG_BOARD_NRF54L15PDK_NRF54L15_CPUFLPR_XIP OR - CONFIG_BOARD_NRF54L15DK_NRF54L15_CPUFLPR) + CONFIG_BOARD_NRF54L15PDK_NRF54L15_CPUFLPR_XIP) message(STATUS "${BOARD}${BOARD_QUALIFIERS} compile as remote in this sample") else() message(FATAL_ERROR "${BOARD}${BOARD_QUALIFIERS} is not supported for this sample") diff --git a/samples/drivers/mbox/remote/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay b/samples/drivers/mbox/remote/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay deleted file mode 100644 index e2bf5bbe06c..00000000000 --- a/samples/drivers/mbox/remote/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2024 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/snippets/nordic-flpr-xip/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/snippets/nordic-flpr-xip/boards/nrf54l15dk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 0007419e1f8..00000000000 --- a/snippets/nordic-flpr-xip/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - soc { - reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - cpuflpr_code_partition: image@165000 { - /* FLPR core code partition */ - reg = <0x165000 DT_SIZE_K(96)>; - }; - }; - }; -}; - -&uart30 { - status = "reserved"; -}; - -&cpuflpr_vpr { - execution-memory = <&cpuflpr_code_partition>; -}; - -&cpuapp_vevif_tx { - status = "okay"; -}; diff --git a/snippets/nordic-flpr-xip/snippet.yml b/snippets/nordic-flpr-xip/snippet.yml index 5a3be000082..d7ca9c25a23 100644 --- a/snippets/nordic-flpr-xip/snippet.yml +++ b/snippets/nordic-flpr-xip/snippet.yml @@ -6,6 +6,3 @@ boards: nrf54l15pdk/nrf54l15/cpuapp: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15pdk_nrf54l15_cpuapp.overlay - nrf54l15dk/nrf54l15/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay diff --git a/snippets/nordic-flpr/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/snippets/nordic-flpr/boards/nrf54l15dk_nrf54l15_cpuapp.overlay deleted file mode 100644 index beb9ece1340..00000000000 --- a/snippets/nordic-flpr/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - soc { - reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - cpuflpr_code_partition: image@165000 { - /* FLPR core code partition */ - reg = <0x165000 DT_SIZE_K(96)>; - }; - }; - - cpuflpr_sram_code_data: memory@20028000 { - compatible = "mmio-sram"; - reg = <0x20028000 DT_SIZE_K(96)>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x20028000 0x18000>; - }; - }; -}; - -&uart30 { - status = "reserved"; -}; - -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(160)>; - ranges = <0x0 0x20000000 0x28000>; -}; - -&cpuflpr_vpr { - execution-memory = <&cpuflpr_sram_code_data>; - source-memory = <&cpuflpr_code_partition>; -}; - -&cpuapp_vevif_tx { - status = "okay"; -}; diff --git a/snippets/nordic-flpr/snippet.yml b/snippets/nordic-flpr/snippet.yml index 1469d3b192e..e214067145f 100644 --- a/snippets/nordic-flpr/snippet.yml +++ b/snippets/nordic-flpr/snippet.yml @@ -6,6 +6,3 @@ boards: nrf54l15pdk/nrf54l15/cpuapp: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15pdk_nrf54l15_cpuapp.overlay - nrf54l15dk/nrf54l15/cpuapp: - append: - EXTRA_DTC_OVERLAY_FILE: boards/nrf54l15dk_nrf54l15_cpuapp.overlay From 3967a356a0c45a48173a1b70b3837bcf09e76199 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 134/825] Revert "[nrf fromtree] test: samples: nRF54L15 support" This reverts commit 4f96507dea264374c118f74afe713d7e050b002b. --- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 8 ---- .../nrf54l15dk_nrf54l15_cpuflpr.overlay | 8 ---- .../nrf54l15dk_nrf54l15_cpuflpr_xip.overlay | 8 ---- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 43 ------------------- .../boards/nrf54l15dk_nrf54l15_cpuapp.overlay | 9 ---- .../nrf54l15dk_nrf54l15_cpuflpr.overlay | 8 ---- .../nrf54l15dk_nrf54l15_cpuflpr_xip.overlay | 8 ---- tests/lib/cpp/cxx/testcase.yaml | 1 - 8 files changed, 93 deletions(-) delete mode 100644 samples/drivers/watchdog/boards/nrf54l15dk_nrf54l15_cpuapp.overlay delete mode 100644 samples/drivers/watchdog/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay delete mode 100644 samples/drivers/watchdog/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay delete mode 100644 tests/drivers/adc/adc_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay delete mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay delete mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay delete mode 100644 tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay diff --git a/samples/drivers/watchdog/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/samples/drivers/watchdog/boards/nrf54l15dk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 5c765a8a896..00000000000 --- a/samples/drivers/watchdog/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/samples/drivers/watchdog/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay b/samples/drivers/watchdog/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay deleted file mode 100644 index 5c765a8a896..00000000000 --- a/samples/drivers/watchdog/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/samples/drivers/watchdog/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay b/samples/drivers/watchdog/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay deleted file mode 100644 index 5c765a8a896..00000000000 --- a/samples/drivers/watchdog/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/tests/drivers/adc/adc_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/adc/adc_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay deleted file mode 100644 index a7252902a0c..00000000000 --- a/tests/drivers/adc/adc_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,43 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2024 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"; - 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_5"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; - zephyr,resolution = <10>; - }; -}; diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 8d3dce3b380..00000000000 --- a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay deleted file mode 100644 index 5c765a8a896..00000000000 --- a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuflpr.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay b/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay deleted file mode 100644 index 5c765a8a896..00000000000 --- a/tests/drivers/watchdog/wdt_basic_api/boards/nrf54l15dk_nrf54l15_cpuflpr_xip.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -&wdt31 { - status = "okay"; -}; diff --git a/tests/lib/cpp/cxx/testcase.yaml b/tests/lib/cpp/cxx/testcase.yaml index d0d29c37018..9554ccf631b 100644 --- a/tests/lib/cpp/cxx/testcase.yaml +++ b/tests/lib/cpp/cxx/testcase.yaml @@ -37,7 +37,6 @@ tests: # Exclude nRF54L15 and nRF54H20 as Nordic HAL is not compatible with C++98. platform_exclude: - nrf54l15pdk/nrf54l15/cpuapp - - nrf54l15dk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad build_only: true From 5297142c94f20415a09f364f7b1ced9808719127 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 135/825] Revert "[nrf fromtree] drivers: misc: Add support for nRF54L15 SoC" This reverts commit f1ee561739a9eab0b5408cda70fd80b848482e6e. --- drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c b/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c index e50161f214c..4a2f185468b 100644 --- a/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c +++ b/drivers/misc/nordic_vpr_launcher/nordic_vpr_launcher.c @@ -14,8 +14,7 @@ #include #include -#if (defined(CONFIG_SOC_NRF54L15_ENGA_CPUAPP) || defined(CONFIG_SOC_NRF54L15_CPUAPP)) && \ - !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) +#if defined(CONFIG_SOC_NRF54L15_ENGA_CPUAPP) && !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) #include #endif @@ -42,8 +41,7 @@ static int nordic_vpr_launcher_init(const struct device *dev) } #endif -#if (defined(CONFIG_SOC_NRF54L15_ENGA_CPUAPP) || defined(CONFIG_SOC_NRF54L15_CPUAPP)) && \ - !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) +#if defined(CONFIG_SOC_NRF54L15_ENGA_CPUAPP) && !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) nrf_spu_periph_perm_secattr_set(NRF_SPU00, nrf_address_slave_get((uint32_t)config->vpr), true); #endif From c99f252b79249cf265c1ee92231cf215ae6b620e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 136/825] Revert "[nrf fromtree] modules: Add support for nRF54L15 SoC" This reverts commit b27ba9e964514a4b3a401df893f9b02d18423d9e. --- modules/hal_nordic/nrfx/CMakeLists.txt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index caa3e85d142..8383aee8779 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -45,9 +45,6 @@ zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54H20_CPUPPR NRF54H20_XXAA zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L15_ENGA NRF54L15_ENGA_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L15_ENGA_CPUAPP NRF_APPLICATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L15_ENGA_CPUFLPR NRF_FLPR) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L15 NRF54L15_XXAA) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L15_CPUAPP NRF_APPLICATION) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54L15_CPUFLPR NRF_FLPR) zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54L15 NRF54L15_XXAA) zephyr_compile_definitions_ifdef(CONFIG_SOC_COMPATIBLE_NRF54L15_CPUAPP NRF_APPLICATION) zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF9120 NRF9120_XXAA) @@ -168,7 +165,7 @@ if(DEFINED uicr_path) endif() endif() -if(CONFIG_SOC_NRF54L15_ENGA_CPUAPP OR CONFIG_SOC_NRF54L15_CPUAPP) +if(CONFIG_SOC_NRF54L15_ENGA_CPUAPP) dt_prop(clock_frequency PATH "/cpus/cpu@0" PROPERTY "clock-frequency") math(EXPR clock_frequency_mhz "${clock_frequency} / 1000000") zephyr_compile_definitions("NRF_CONFIG_CPU_FREQ_MHZ=${clock_frequency_mhz}") @@ -213,7 +210,5 @@ mdk_svd_ifdef(CONFIG_SOC_NRF54H20_CPUPPR nrf54h20_ppr.svd) mdk_svd_ifdef(CONFIG_SOC_NRF54H20_CPURAD nrf54h20_radiocore.svd) mdk_svd_ifdef(CONFIG_SOC_NRF54L15_ENGA_CPUAPP nrf54l15_enga_application.svd) mdk_svd_ifdef(CONFIG_SOC_NRF54L15_ENGA_CPUFLPR nrf54l15_enga_flpr.svd) -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_NRF9120 nrf9120.svd) mdk_svd_ifdef(CONFIG_SOC_NRF9160 nrf9160.svd) From f2bfa52c826182216c4656c37ef2c7404d2b49da Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 137/825] Revert "[nrf fromtree] boards: nrf: Add nRF54L15 DK board" This reverts commit 4ae94bbdbdd05cfb5fafdd62fcf164ec8260a8b7. --- boards/nordic/nrf54l15dk/Kconfig.defconfig | 12 -- boards/nordic/nrf54l15dk/Kconfig.nrf54l15dk | 7 - boards/nordic/nrf54l15dk/board.cmake | 11 -- boards/nordic/nrf54l15dk/board.yml | 8 - .../doc/img/nrf54l15dk_nrf54l15.webp | Bin 41406 -> 0 bytes boards/nordic/nrf54l15dk/doc/index.rst | 145 ---------------- .../nrf54l15dk/nrf54l15_cpuapp_common.dtsi | 156 ------------------ .../nrf54l15dk_nrf54l15-common.dtsi | 100 ----------- .../nrf54l15dk_nrf54l15-pinctrl.dtsi | 80 --------- .../nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.dts | 19 --- .../nrf54l15dk_nrf54l15_cpuapp.yaml | 24 --- .../nrf54l15dk_nrf54l15_cpuapp_defconfig | 29 ---- .../nrf54l15dk_nrf54l15_cpuflpr.dts | 71 -------- .../nrf54l15dk_nrf54l15_cpuflpr.yaml | 18 -- .../nrf54l15dk_nrf54l15_cpuflpr_defconfig | 17 -- .../nrf54l15dk_nrf54l15_cpuflpr_xip.dts | 12 -- .../nrf54l15dk_nrf54l15_cpuflpr_xip.yaml | 18 -- .../nrf54l15dk_nrf54l15_cpuflpr_xip_defconfig | 15 -- 18 files changed, 742 deletions(-) delete mode 100644 boards/nordic/nrf54l15dk/Kconfig.defconfig delete mode 100644 boards/nordic/nrf54l15dk/Kconfig.nrf54l15dk delete mode 100644 boards/nordic/nrf54l15dk/board.cmake delete mode 100644 boards/nordic/nrf54l15dk/board.yml delete mode 100644 boards/nordic/nrf54l15dk/doc/img/nrf54l15dk_nrf54l15.webp delete mode 100644 boards/nordic/nrf54l15dk/doc/index.rst delete mode 100644 boards/nordic/nrf54l15dk/nrf54l15_cpuapp_common.dtsi delete mode 100644 boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15-common.dtsi delete mode 100644 boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15-pinctrl.dtsi delete mode 100644 boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.dts delete mode 100644 boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml delete mode 100644 boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_defconfig delete mode 100644 boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts delete mode 100644 boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.yaml delete mode 100644 boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_defconfig delete mode 100644 boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_xip.dts delete mode 100644 boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_xip.yaml delete mode 100644 boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_xip_defconfig diff --git a/boards/nordic/nrf54l15dk/Kconfig.defconfig b/boards/nordic/nrf54l15dk/Kconfig.defconfig deleted file mode 100644 index 2b753df3515..00000000000 --- a/boards/nordic/nrf54l15dk/Kconfig.defconfig +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_NRF54L15DK_NRF54L15_CPUAPP - -config BT_CTLR - default BT - -config ROM_START_OFFSET - default 0x800 if BOOTLOADER_MCUBOOT - -endif # BOARD_NRF54L15DK_NRF54L15_CPUAPP diff --git a/boards/nordic/nrf54l15dk/Kconfig.nrf54l15dk b/boards/nordic/nrf54l15dk/Kconfig.nrf54l15dk deleted file mode 100644 index e385ef84f89..00000000000 --- a/boards/nordic/nrf54l15dk/Kconfig.nrf54l15dk +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_NRF54L15DK - select SOC_NRF54L15_CPUAPP if BOARD_NRF54L15DK_NRF54L15_CPUAPP - select SOC_NRF54L15_CPUFLPR if BOARD_NRF54L15DK_NRF54L15_CPUFLPR || \ - BOARD_NRF54L15DK_NRF54L15_CPUFLPR_XIP diff --git a/boards/nordic/nrf54l15dk/board.cmake b/boards/nordic/nrf54l15dk/board.cmake deleted file mode 100644 index 1fd92b7fced..00000000000 --- a/boards/nordic/nrf54l15dk/board.cmake +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if(CONFIG_SOC_NRF54L15_CPUAPP) - board_runner_args(jlink "--device=cortex-m33" "--speed=4000") -elseif(CONFIG_SOC_NRF54L15_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/nrf54l15dk/board.yml b/boards/nordic/nrf54l15dk/board.yml deleted file mode 100644 index 7a8bf2f5cf1..00000000000 --- a/boards/nordic/nrf54l15dk/board.yml +++ /dev/null @@ -1,8 +0,0 @@ -board: - name: nrf54l15dk - vendor: nordic - socs: - - name: nrf54l15 - variants: - - name: xip - cpucluster: cpuflpr diff --git a/boards/nordic/nrf54l15dk/doc/img/nrf54l15dk_nrf54l15.webp b/boards/nordic/nrf54l15dk/doc/img/nrf54l15dk_nrf54l15.webp deleted file mode 100644 index bac57d69e625bf664adeae76abe293f559e74634..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 41406 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 z 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 ios-5w90T2nevpLe*?<550000000000000000001UWc?8U diff --git a/boards/nordic/nrf54l15dk/doc/index.rst b/boards/nordic/nrf54l15dk/doc/index.rst deleted file mode 100644 index 6980076d954..00000000000 --- a/boards/nordic/nrf54l15dk/doc/index.rst +++ /dev/null @@ -1,145 +0,0 @@ -.. _nrf54l15dk_nrf54l15: - -nRF54L15 DK -############ - -Overview -******** - -.. note:: - - All software for the nRF54L15 SoC is experimental and hardware availability - is restricted to the participants in the limited sampling program. - -The nRF54L15 Development Kit hardware provides support for the Nordic Semiconductor -nRF54L15 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)` -* :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)` - -.. figure:: img/nrf54l15dk_nrf54l15.webp - :align: center - :alt: nRF54L15 DK - - nRF54L15 DK (Credit: Nordic Semiconductor) - -Hardware -******** - -nRF54L15 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 -================== - -The ``nrf54l15dk/nrf54l15/cpuapp`` board target configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| GRTC | on-chip | counter | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RRAM | on-chip | flash | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SAADC | on-chip | adc | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| SPU | on-chip | system protection | -+-----------+------------+----------------------+ -| TWIM | on-chip | i2c | -+-----------+------------+----------------------+ -| UARTE | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. - -Programming and Debugging -************************* - -Applications for the ``nrf54l15dk/nrf54l15/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 ``nrf54l15dk/nrf54l15/cpuflpr`` board target need -to be build as multicore configuration with code snippet called ``vpr_launcher`` -for the application core. - -Enter the following command to compile ``hello_world`` for the FLPR core:: - west build -p -b nrf54l15pdk/nrf54l15/cpuflpr --sysbuild -- -DSB_VPR_LAUNCHER=y - -Flashing -======== - -As an example, this section shows how to build and flash the :ref:`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 nRF54L15 DK, complete the following steps: - -First, connect the nRF54L15 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: nrf54l15dk/nrf54l15/cpuapp - :goals: build flash - -Testing the LEDs and buttons in the nRF54L15 DK -************************************************ - -Test the nRF54L15 DK with a :zephyr:code-sample:`blinky` sample. diff --git a/boards/nordic/nrf54l15dk/nrf54l15_cpuapp_common.dtsi b/boards/nordic/nrf54l15dk/nrf54l15_cpuapp_common.dtsi deleted file mode 100644 index 191babb632f..00000000000 --- a/boards/nordic/nrf54l15dk/nrf54l15_cpuapp_common.dtsi +++ /dev/null @@ -1,156 +0,0 @@ -/* - * 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 "nrf54l15dk_nrf54l15-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,ieee802154 = &ieee802154; - }; -}; - -&cpuapp_sram { - status = "okay"; -}; - -&lfxo { - load-capacitors = "internal"; - load-capacitance-femtofarad = <15500>; -}; - -&hfxo { - load-capacitors = "internal"; - load-capacitance-femtofarad = <15000>; -}; - -®ulators { - status = "okay"; -}; - -&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(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)>; - }; - }; -}; - -&uart20 { - status = "okay"; -}; - -&gpio0 { - status = "okay"; -}; - -&gpio1 { - status = "okay"; -}; - -&gpio2 { - status = "okay"; -}; - -&gpiote20 { - status = "okay"; -}; - -&gpiote30 { - status = "okay"; -}; - -&radio { - status = "okay"; -}; - -&ieee802154 { - status = "okay"; -}; - -&temp { - status = "okay"; -}; - -&clock { - 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 = "okay"; - 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>; - }; -}; - -&adc { - status = "okay"; -}; diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15-common.dtsi b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15-common.dtsi deleted file mode 100644 index 02170276476..00000000000 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15-common.dtsi +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15dk_nrf54l15-pinctrl.dtsi" - -/ { - leds { - compatible = "gpio-leds"; - led0: led_0 { - gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; - label = "Green LED 0"; - }; - led1: led_1 { - gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; - label = "Green LED 1"; - }; - led2: led_2 { - gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>; - label = "Green LED 2"; - }; - led3: led_3 { - gpios = <&gpio1 14 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. - * Only LEDs connected to P1 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 13 (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 4 (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/nrf54l15dk/nrf54l15dk_nrf54l15-pinctrl.dtsi b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15-pinctrl.dtsi deleted file mode 100644 index 0b6e2056a82..00000000000 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15-pinctrl.dtsi +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2024 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/ 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/ pwm20_default: pwm20_default { - group1 { - psels = ; - }; - }; - - /omit-if-no-ref/ pwm20_sleep: pwm20_sleep { - group1 { - psels = ; - low-power-enable; - }; - }; -}; diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.dts b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.dts deleted file mode 100644 index b71f55c5fb4..00000000000 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.dts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include "nrf54l15_cpuapp_common.dtsi" - -/ { - compatible = "nordic,nrf54l15dk_nrf54l15-cpuapp"; - model = "Nordic nRF54L15 DK nRF54L15 Application MCU"; - - chosen { - zephyr,code-partition = &slot0_partition; - zephyr,sram = &cpuapp_sram; - }; -}; diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml deleted file mode 100644 index a3ddb5db1c6..00000000000 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf54l15dk/nrf54l15/cpuapp -name: nRF54l15-DK-nRF54l15-Application -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -sysbuild: true -ram: 188 -flash: 324 -supported: - - adc - - counter - - gpio - - i2c - - pwm - - retained_mem - - spi - - watchdog - - i2s diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_defconfig b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_defconfig deleted file mode 100644 index 02796a1361e..00000000000 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_defconfig +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2024 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/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts deleted file mode 100644 index 472e3f2b8d3..00000000000 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.dts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; -#include -#include "nrf54l15dk_nrf54l15-common.dtsi" - -/ { - model = "Nordic nRF54L15 DK nRF54L15 FLPR MCU"; - compatible = "nordic,nrf54l15dk_nrf54l15-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"; - /* size must be increased due to booting from SRAM */ - reg = <0x20028000 DT_SIZE_K(96)>; - ranges = <0x0 0x20028000 0x18000>; -}; - -&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/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.yaml b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.yaml deleted file mode 100644 index 927773e0d5a..00000000000 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf54l15dk/nrf54l15/cpuflpr -name: nRF54L15-DK-nRF54L15-Fast-Lightweight-Peripheral-Processor -type: mcu -arch: riscv -toolchain: - - zephyr -sysbuild: true -ram: 96 -flash: 96 -supported: - - counter - - gpio - - i2c - - spi - - watchdog diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_defconfig b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_defconfig deleted file mode 100644 index 256ac9103b4..00000000000 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_defconfig +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2024 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 diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_xip.dts b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_xip.dts deleted file mode 100644 index 6855e091d3c..00000000000 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_xip.dts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54l15dk_nrf54l15_cpuflpr.dts" - -&cpuflpr_sram { - reg = <0x2002f000 DT_SIZE_K(68)>; - ranges = <0x0 0x2002f000 0x11000>; -}; diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_xip.yaml b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_xip.yaml deleted file mode 100644 index d82dea6491f..00000000000 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_xip.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -identifier: nrf54l15dk/nrf54l15/cpuflpr/xip -name: nRF54L15-DK-nRF54L15-Fast-Lightweight-Peripheral-Processor (RRAM XIP) -type: mcu -arch: riscv -toolchain: - - zephyr -sysbuild: true -ram: 68 -flash: 96 -supported: - - counter - - gpio - - i2c - - spi - - watchdog diff --git a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_xip_defconfig b/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_xip_defconfig deleted file mode 100644 index 0a436a648b4..00000000000 --- a/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuflpr_xip_defconfig +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2024 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 - -# Execute from RRAM -CONFIG_XIP=y From 779c9114826f3b74737ab2ea8b6ad7196eb10bc6 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 138/825] Revert "[nrf fromtree] soc: Add support for nRF54L15" This reverts commit d5ca810bc8f0730c7c872f727163e3a0230d76e3. --- soc/nordic/common/vpr/Kconfig.sysbuild | 2 +- soc/nordic/nrf54l/Kconfig | 14 -------------- .../nrf54l/Kconfig.defconfig.nrf54l15_cpuapp | 11 ----------- .../nrf54l/Kconfig.defconfig.nrf54l15_cpuflpr | 11 ----------- soc/nordic/nrf54l/Kconfig.soc | 12 ------------ 5 files changed, 1 insertion(+), 49 deletions(-) delete mode 100644 soc/nordic/nrf54l/Kconfig.defconfig.nrf54l15_cpuapp delete mode 100644 soc/nordic/nrf54l/Kconfig.defconfig.nrf54l15_cpuflpr diff --git a/soc/nordic/common/vpr/Kconfig.sysbuild b/soc/nordic/common/vpr/Kconfig.sysbuild index 54464f10bc4..84fbad22f26 100644 --- a/soc/nordic/common/vpr/Kconfig.sysbuild +++ b/soc/nordic/common/vpr/Kconfig.sysbuild @@ -4,7 +4,7 @@ config VPR_LAUNCHER bool "VPR launcher" default y - depends on (SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR || SOC_NRF54L15_ENGA_CPUFLPR || SOC_NRF54L15_CPUFLPR || SOC_NRF9280_CPUPPR) + depends on (SOC_NRF54H20_CPUPPR || SOC_NRF54L15_ENGA_CPUFLPR) help Include VPR launcher in build. VPR launcher is a minimal sample built for an ARM core that starts given VPR core. diff --git a/soc/nordic/nrf54l/Kconfig b/soc/nordic/nrf54l/Kconfig index d7d49c70832..75051686619 100644 --- a/soc/nordic/nrf54l/Kconfig +++ b/soc/nordic/nrf54l/Kconfig @@ -19,23 +19,9 @@ config SOC_NRF54L15_ENGA_CPUAPP select HAS_HW_NRF_RADIO_IEEE802154 select HAS_POWEROFF -config SOC_NRF54L15_CPUAPP - select ARM - select ARMV8_M_DSP - select CPU_CORTEX_M33 - select CPU_HAS_ARM_MPU - select CPU_HAS_ICACHE - select CPU_HAS_ARM_SAU - select CPU_HAS_FPU - select HAS_HW_NRF_RADIO_IEEE802154 - select HAS_POWEROFF - config SOC_NRF54L15_ENGA_CPUFLPR depends on RISCV_CORE_NORDIC_VPR -config SOC_NRF54L15_CPUFLPR - depends on RISCV_CORE_NORDIC_VPR - if SOC_SERIES_NRF54LX config SOC_NRF54LX_SKIP_CLOCK_CONFIG diff --git a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54l15_cpuapp b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54l15_cpuapp deleted file mode 100644 index 9c8e0b4e34b..00000000000 --- a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54l15_cpuapp +++ /dev/null @@ -1,11 +0,0 @@ -# Nordic Semiconductor nRF54L15 MCU - -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if SOC_NRF54L15_CPUAPP - -config NUM_IRQS - default 271 - -endif # SOC_NRF54L15_CPUAPP diff --git a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54l15_cpuflpr b/soc/nordic/nrf54l/Kconfig.defconfig.nrf54l15_cpuflpr deleted file mode 100644 index eabd1844c90..00000000000 --- a/soc/nordic/nrf54l/Kconfig.defconfig.nrf54l15_cpuflpr +++ /dev/null @@ -1,11 +0,0 @@ -# Nordic Semiconductor nRF54L15 MCU - -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if SOC_NRF54L15_CPUFLPR - -config NUM_IRQS - default 287 - -endif # SOC_NRF54L15_CPUFLPR diff --git a/soc/nordic/nrf54l/Kconfig.soc b/soc/nordic/nrf54l/Kconfig.soc index ebb108b626e..506db433b2b 100644 --- a/soc/nordic/nrf54l/Kconfig.soc +++ b/soc/nordic/nrf54l/Kconfig.soc @@ -27,17 +27,5 @@ config SOC_NRF54L15_ENGA_CPUFLPR help NRF54L15 ENGA CPUFLPR -config SOC_NRF54L15_CPUAPP - bool - select SOC_NRF54L15 - help - NRF54L15 CPUAPP - -config SOC_NRF54L15_CPUFLPR - bool - select SOC_NRF54L15 - help - NRF54L15 CPUFLPR - config SOC default "nrf54l15" if SOC_NRF54L15 From 707fdcc1255a8615af82c90364b7b07068a7b56f Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 139/825] Revert "[nrf fromtree] dts: Add missing PDM entries to nRF54L15 device" This reverts commit 01a9775eb31eaa034960046800dec926f60f4f6a. --- dts/common/nordic/nrf54l15.dtsi | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/dts/common/nordic/nrf54l15.dtsi b/dts/common/nordic/nrf54l15.dtsi index 39a3d70e2c1..df0a52639bb 100644 --- a/dts/common/nordic/nrf54l15.dtsi +++ b/dts/common/nordic/nrf54l15.dtsi @@ -398,20 +398,6 @@ 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"; From 61c1cc0aefcdd8f7766c3d6fa0a398b4e0e1a5c5 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:56 +0200 Subject: [PATCH 140/825] Revert "[nrf fromtree] dts: bindings: regulator: add nordic,nrf5[2]x-regulator[-hv]" This reverts commit 50b0bbf51d873def07fc8fb147692bdddf9fb666. --- .../regulator/nordic,nrf52x-regulator-hv.yaml | 20 -------------- .../regulator/nordic,nrf5x-regulator.yaml | 24 ----------------- include/zephyr/dt-bindings/regulator/nrf5x.h | 27 ------------------- 3 files changed, 71 deletions(-) delete mode 100644 dts/bindings/regulator/nordic,nrf52x-regulator-hv.yaml delete mode 100644 dts/bindings/regulator/nordic,nrf5x-regulator.yaml delete mode 100644 include/zephyr/dt-bindings/regulator/nrf5x.h diff --git a/dts/bindings/regulator/nordic,nrf52x-regulator-hv.yaml b/dts/bindings/regulator/nordic,nrf52x-regulator-hv.yaml deleted file mode 100644 index 3af5dbdff73..00000000000 --- a/dts/bindings/regulator/nordic,nrf52x-regulator-hv.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c), 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - Nordic nRF52X regulator (high voltage stage of the main supply) - -compatible: "nordic,nrf52x-regulator-hv" - -include: - - name: base.yaml - - name: regulator.yaml - property-allowlist: - - regulator-name - -properties: - reg: - required: true - - regulator-name: - required: true diff --git a/dts/bindings/regulator/nordic,nrf5x-regulator.yaml b/dts/bindings/regulator/nordic,nrf5x-regulator.yaml deleted file mode 100644 index 530a0634e76..00000000000 --- a/dts/bindings/regulator/nordic,nrf5x-regulator.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c), 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - Nordic nRF5X regulator (fixed stage of the core supply) - -compatible: "nordic,nrf5x-regulator" - -include: - - name: base.yaml - - name: regulator.yaml - property-allowlist: - - regulator-name - - regulator-initial-mode - -properties: - reg: - required: true - - regulator-name: - required: true - - regulator-initial-mode: - required: true diff --git a/include/zephyr/dt-bindings/regulator/nrf5x.h b/include/zephyr/dt-bindings/regulator/nrf5x.h deleted file mode 100644 index d2507c74a6e..00000000000 --- a/include/zephyr/dt-bindings/regulator/nrf5x.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_REGULATOR_NRF5X_H_ -#define ZEPHYR_INCLUDE_DT_BINDINGS_REGULATOR_NRF_H_ - -/** - * @defgroup regulator_nrf5x nRF5X regulator devicetree helpers. - * @ingroup regulator_interface - * @{ - */ - -/** - * @name nRF5X regulator modes - * @{ - */ -/** LDO mode */ -#define NRF5X_REG_MODE_LDO 0 -/** DC/DC mode */ -#define NRF5X_REG_MODE_DCDC 1 -/** @} */ - -/** @} */ - -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_REGULATOR_NRF5X_H_*/ From 7b9dafef860b2817680d562231d3bb6ceacbc45a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 141/825] Revert "[nrf fromlist] tests: bluetooth: tester: refactor CSIP btp command" This reverts commit cde1b1d794706318d03278ddded3142c455e39d3. --- tests/bluetooth/tester/src/btp/btp_csip.h | 6 +-- tests/bluetooth/tester/src/btp_csip.c | 57 ++--------------------- 2 files changed, 5 insertions(+), 58 deletions(-) diff --git a/tests/bluetooth/tester/src/btp/btp_csip.h b/tests/bluetooth/tester/src/btp/btp_csip.h index 362f1bafd75..bfc5bcf085f 100644 --- a/tests/bluetooth/tester/src/btp/btp_csip.h +++ b/tests/bluetooth/tester/src/btp/btp_csip.h @@ -25,14 +25,12 @@ struct btp_csip_start_ordered_access_cmd { #define BTP_CSIP_SET_COORDINATOR_LOCK 0x04 struct btp_csip_set_coordinator_lock_cmd { - uint8_t addr_cnt; - bt_addr_le_t addr[]; + uint8_t count; } __packed; #define BTP_CSIP_SET_COORDINATOR_RELEASE 0x05 struct btp_csip_set_coordinator_release_cmd { - uint8_t addr_cnt; - bt_addr_le_t addr[]; + uint8_t count; } __packed; /* CSIP Events */ diff --git a/tests/bluetooth/tester/src/btp_csip.c b/tests/bluetooth/tester/src/btp_csip.c index 62df2c71717..497a313e5a2 100644 --- a/tests/bluetooth/tester/src/btp_csip.c +++ b/tests/bluetooth/tester/src/btp_csip.c @@ -16,7 +16,6 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL); const struct bt_csip_set_coordinator_set_member *btp_csip_set_members[CONFIG_BT_MAX_CONN]; static const struct bt_csip_set_coordinator_csis_inst *cur_csis_inst; static struct bt_csip_set_coordinator_svc_inst *csip_inst; -static uint8_t members_count; static uint8_t btp_csip_supported_commands(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) @@ -190,53 +189,15 @@ static uint8_t btp_csip_discover(const void *cmd, uint16_t cmd_len, return BTP_STATUS_VAL(err); } -static int get_available_members(const struct bt_csip_set_coordinator_set_member **members) -{ - members_count = 0; - - if (cur_csis_inst == NULL) { - LOG_ERR("No CISP instance available"); - return BTP_STATUS_FAILED; - } - - for (size_t i = 0; i < (size_t)ARRAY_SIZE(btp_csip_set_members); i++) { - if (btp_csip_set_members[i] == NULL) { - continue; - } - - members[members_count++] = btp_csip_set_members[i]; - } - - if (members_count == 0) { - LOG_ERR("No set members available"); - return BTP_STATUS_FAILED; - } - - return BTP_STATUS_SUCCESS; -} - static uint8_t btp_csip_set_coordinator_lock(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) { - const struct bt_csip_set_coordinator_set_member *members[ARRAY_SIZE(btp_csip_set_members)]; const struct btp_csip_set_coordinator_lock_cmd *cp = cmd; int err; - int rc; LOG_DBG(""); - if (cp->addr_cnt != 0) { - /* TODO: add support for lock request procedure on subset of set members */ - return BTP_STATUS_FAILED; - } - - rc = get_available_members(members); - - if (rc) { - return BTP_STATUS_FAILED; - } - - err = bt_csip_set_coordinator_lock(members, members_count, &cur_csis_inst->info); + err = bt_csip_set_coordinator_lock(btp_csip_set_members, cp->count, &cur_csis_inst->info); if (err) { LOG_DBG("Failed to lock set members"); @@ -249,25 +210,13 @@ static uint8_t btp_csip_set_coordinator_lock(const void *cmd, uint16_t cmd_len, static uint8_t btp_csip_set_coordinator_release(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) { - const struct bt_csip_set_coordinator_set_member *members[ARRAY_SIZE(btp_csip_set_members)]; const struct btp_csip_set_coordinator_release_cmd *cp = cmd; int err; - int rc; LOG_DBG(""); - if (cp->addr_cnt != 0) { - /* TODO: add support for lock release procedure on subset of set members */ - return BTP_STATUS_FAILED; - } - - rc = get_available_members(members); - - if (rc) { - return BTP_STATUS_FAILED; - } - - err = bt_csip_set_coordinator_release(members, members_count, &cur_csis_inst->info); + err = bt_csip_set_coordinator_release(btp_csip_set_members, cp->count, + &cur_csis_inst->info); if (err) { LOG_DBG("Failed to release set members"); From 0334e50007f73b9f96b84322119c8df184f7e95b Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 142/825] Revert "[nrf fromtree] drivers: hwinfo: Add support for generating device id from device addr" This reverts commit 425e40b8b66391cffab75cb12829954b6e85f426. --- drivers/hwinfo/Kconfig | 2 +- drivers/hwinfo/hwinfo_nrf.c | 33 ++++++++------------------------- 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/drivers/hwinfo/Kconfig b/drivers/hwinfo/Kconfig index f8e80872c6f..0d3f6b991f9 100644 --- a/drivers/hwinfo/Kconfig +++ b/drivers/hwinfo/Kconfig @@ -67,7 +67,7 @@ config HWINFO_NRF bool "NRF device ID" default y depends on SOC_FAMILY_NORDIC_NRF - depends on SOC_SERIES_NRF54HX || NRF_SOC_SECURE_SUPPORTED + depends on NRF_SOC_SECURE_SUPPORTED help Enable Nordic NRF hwinfo driver. diff --git a/drivers/hwinfo/hwinfo_nrf.c b/drivers/hwinfo/hwinfo_nrf.c index d1fca5350a6..8b644f2f60e 100644 --- a/drivers/hwinfo/hwinfo_nrf.c +++ b/drivers/hwinfo/hwinfo_nrf.c @@ -8,7 +8,7 @@ #include #include #include -#if !defined(CONFIG_SOC_SERIES_NRF54HX) && !defined(CONFIG_BOARD_QEMU_CORTEX_M0) +#ifndef CONFIG_BOARD_QEMU_CORTEX_M0 #include #endif @@ -25,34 +25,17 @@ struct nrf_uid { ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length) { struct nrf_uid dev_id; - uint32_t buf[2]; + uint32_t deviceid[2]; -#if NRF_FICR_HAS_DEVICE_ID || NRF_FICR_HAS_INFO_DEVICE_ID - /* DEVICEID is accessible, use this */ #if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && defined(NRF_FICR_S) - soc_secure_read_deviceid(buf); + soc_secure_read_deviceid(deviceid); #else - buf[0] = nrf_ficr_deviceid_get(NRF_FICR, 0); - buf[1] = nrf_ficr_deviceid_get(NRF_FICR, 1); -#endif -#elif NRF_FICR_HAS_DEVICE_ADDR || NRF_FICR_HAS_BLE_ADDR - /* DEVICEID is not accessible, use device/ble address instead. - * Assume that it is always accessible from the non-secure image. - */ - buf[0] = nrf_ficr_deviceaddr_get(NRF_FICR, 0); - buf[1] = nrf_ficr_deviceaddr_get(NRF_FICR, 1); - - /* Assume that ER and IR are available whenever deviceaddr is. - * Use the LSBytes from ER and IR to complete the device id. - */ - buf[1] |= (nrf_ficr_er_get(NRF_FICR, 0) & 0xFF) << 16; - buf[1] |= (nrf_ficr_ir_get(NRF_FICR, 0) & 0xFF) << 24; -#else -#error "No suitable source for hwinfo device_id generation" + deviceid[0] = nrf_ficr_deviceid_get(NRF_FICR, 0); + deviceid[1] = nrf_ficr_deviceid_get(NRF_FICR, 1); #endif - dev_id.id[0] = sys_cpu_to_be32(buf[1]); - dev_id.id[1] = sys_cpu_to_be32(buf[0]); + dev_id.id[0] = sys_cpu_to_be32(deviceid[1]); + dev_id.id[1] = sys_cpu_to_be32(deviceid[0]); if (length > sizeof(dev_id.id)) { length = sizeof(dev_id.id); @@ -63,7 +46,7 @@ ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length) return length; } -#if !defined(CONFIG_SOC_SERIES_NRF54HX) && !defined(CONFIG_BOARD_QEMU_CORTEX_M0) +#ifndef CONFIG_BOARD_QEMU_CORTEX_M0 int z_impl_hwinfo_get_reset_cause(uint32_t *cause) { uint32_t flags = 0; From c6943fb7c39084b34ec022cc2f0418ccd750a855 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 143/825] Revert "[nrf fromtree] drivers: serial: nrf: add default value for frame timeout cfg" This reverts commit 1e3b3f5e9462ea60494efd9cbc49c2e8c84b08c3. --- drivers/serial/uart_nrfx_uarte.c | 4 ---- drivers/serial/uart_nrfx_uarte2.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index ef1cc20e67a..d2b36017051 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -386,10 +386,6 @@ static int uarte_nrfx_configure(const struct device *dev, struct uarte_nrfx_data *data = dev->data; nrf_uarte_config_t uarte_cfg; -#if NRF_UARTE_HAS_FRAME_TIMEOUT - uarte_cfg.frame_timeout = NRF_UARTE_FRAME_TIMEOUT_DIS; -#endif - #if defined(UARTE_CONFIG_STOP_Msk) switch (cfg->stop_bits) { case UART_CFG_STOP_BITS_1: diff --git a/drivers/serial/uart_nrfx_uarte2.c b/drivers/serial/uart_nrfx_uarte2.c index e00fe7a6d0a..99c70f47831 100644 --- a/drivers/serial/uart_nrfx_uarte2.c +++ b/drivers/serial/uart_nrfx_uarte2.c @@ -643,10 +643,6 @@ static int uarte_nrfx_configure(const struct device *dev, struct uarte_nrfx_data *data = dev->data; nrf_uarte_config_t uarte_cfg; -#if NRF_UARTE_HAS_FRAME_TIMEOUT - uarte_cfg.frame_timeout = NRF_UARTE_FRAME_TIMEOUT_DIS; -#endif - #if defined(UARTE_CONFIG_STOP_Msk) switch (cfg->stop_bits) { case UART_CFG_STOP_BITS_1: From 8f76717bcc384cb26b75f6f7afdd577ab440dbea Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 144/825] Revert "[nrf fromtree] modules: hal_nordic: nrfx: sync configs for UARTE MAGIC_BYTE option" This reverts commit c34addeebcafee68ec9ab3bbb0404c4ce79a572d. --- modules/hal_nordic/nrfx/nrfx_config_common.h | 2 +- modules/hal_nordic/nrfx/nrfx_config_nrf52805.h | 9 --------- modules/hal_nordic/nrfx/nrfx_config_nrf52810.h | 9 --------- modules/hal_nordic/nrfx/nrfx_config_nrf52811.h | 9 --------- modules/hal_nordic/nrfx/nrfx_config_nrf52820.h | 9 --------- modules/hal_nordic/nrfx/nrfx_config_nrf52832.h | 9 --------- modules/hal_nordic/nrfx/nrfx_config_nrf52833.h | 9 --------- modules/hal_nordic/nrfx/nrfx_config_nrf52840.h | 9 --------- .../hal_nordic/nrfx/nrfx_config_nrf5340_application.h | 9 --------- modules/hal_nordic/nrfx/nrfx_config_nrf5340_network.h | 9 --------- .../hal_nordic/nrfx/nrfx_config_nrf54h20_application.h | 9 --------- modules/hal_nordic/nrfx/nrfx_config_nrf54h20_ppr.h | 9 --------- modules/hal_nordic/nrfx/nrfx_config_nrf54h20_radiocore.h | 9 --------- .../nrfx/nrfx_config_nrf54l15_enga_application.h | 9 --------- modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_flpr.h | 9 --------- modules/hal_nordic/nrfx/nrfx_config_nrf91.h | 9 --------- 16 files changed, 1 insertion(+), 136 deletions(-) diff --git a/modules/hal_nordic/nrfx/nrfx_config_common.h b/modules/hal_nordic/nrfx/nrfx_config_common.h index f156c21777f..88a1a8b95e8 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_common.h +++ b/modules/hal_nordic/nrfx/nrfx_config_common.h @@ -18,7 +18,7 @@ /** @brief Symbol specifying minor version of the nrfx API to be used. */ #ifndef NRFX_CONFIG_API_VER_MINOR -#define NRFX_CONFIG_API_VER_MINOR 6 +#define NRFX_CONFIG_API_VER_MINOR 3 #endif /** @brief Symbol specifying micro version of the nrfx API to be used. */ diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf52805.h b/modules/hal_nordic/nrfx/nrfx_config_nrf52805.h index 3ae4fa2228c..33074008de4 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf52805.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf52805.h @@ -1012,15 +1012,6 @@ #define NRFX_UARTE_ENABLED 0 #endif -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf52810.h b/modules/hal_nordic/nrfx/nrfx_config_nrf52810.h index c61641c8719..ebd63c25ed8 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf52810.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf52810.h @@ -1147,15 +1147,6 @@ #define NRFX_UARTE_ENABLED 0 #endif -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf52811.h b/modules/hal_nordic/nrfx/nrfx_config_nrf52811.h index 152569ed899..01169f7b983 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf52811.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf52811.h @@ -1174,15 +1174,6 @@ #define NRFX_UARTE_ENABLED 0 #endif -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf52820.h b/modules/hal_nordic/nrfx/nrfx_config_nrf52820.h index 863b073f028..bfa74322458 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf52820.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf52820.h @@ -1111,15 +1111,6 @@ #define NRFX_UARTE_ENABLED 0 #endif -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf52832.h b/modules/hal_nordic/nrfx/nrfx_config_nrf52832.h index b181bf6cdcc..4e5fe9d5835 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf52832.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf52832.h @@ -1503,15 +1503,6 @@ #define NRFX_UARTE_ENABLED 0 #endif -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf52833.h b/modules/hal_nordic/nrfx/nrfx_config_nrf52833.h index f53b04eb62d..fc415c59dc3 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf52833.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf52833.h @@ -1471,15 +1471,6 @@ #define NRFX_UARTE_ENABLED 0 #endif -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf52840.h b/modules/hal_nordic/nrfx/nrfx_config_nrf52840.h index 0c49a6e5474..ac7a62fc931 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf52840.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf52840.h @@ -1498,15 +1498,6 @@ #define NRFX_UARTE_ENABLED 0 #endif -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf5340_application.h b/modules/hal_nordic/nrfx/nrfx_config_nrf5340_application.h index a5dbcaa3db8..18bcc40b2ac 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf5340_application.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf5340_application.h @@ -1377,15 +1377,6 @@ #define NRFX_UARTE_ENABLED 0 #endif -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf5340_network.h b/modules/hal_nordic/nrfx/nrfx_config_nrf5340_network.h index 938172460fa..f9cd5c926b5 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf5340_network.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf5340_network.h @@ -783,15 +783,6 @@ #define NRFX_UARTE_ENABLED 0 #endif -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf54h20_application.h b/modules/hal_nordic/nrfx/nrfx_config_nrf54h20_application.h index 7f5d4d30ce9..5b91d921c7c 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf54h20_application.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf54h20_application.h @@ -1733,15 +1733,6 @@ #define NRFX_UARTE_CONFIG_RX_CACHE_ENABLED 1 #endif -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf54h20_ppr.h b/modules/hal_nordic/nrfx/nrfx_config_nrf54h20_ppr.h index d274abb5b88..4a4e6c08a8a 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf54h20_ppr.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf54h20_ppr.h @@ -1670,15 +1670,6 @@ #define NRFX_UARTE_CONFIG_RX_CACHE_ENABLED 1 #endif -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf54h20_radiocore.h b/modules/hal_nordic/nrfx/nrfx_config_nrf54h20_radiocore.h index 3a6cde96126..274073e6a38 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf54h20_radiocore.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf54h20_radiocore.h @@ -1797,15 +1797,6 @@ #define NRFX_UARTE_CONFIG_RX_CACHE_ENABLED 1 #endif -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_application.h b/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_application.h index eeea811aeff..8383b869d71 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_application.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_application.h @@ -1517,15 +1517,6 @@ #define NRFX_UARTE_CONFIG_TX_LINK 1 #endif -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_flpr.h b/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_flpr.h index 7f3c5a80c2c..729a21606ed 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_flpr.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_flpr.h @@ -1509,15 +1509,6 @@ #define NRFX_UARTE_CONFIG_TX_LINK 1 #endif -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf91.h b/modules/hal_nordic/nrfx/nrfx_config_nrf91.h index b7c471789fa..c6029a18628 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf91.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf91.h @@ -1097,15 +1097,6 @@ #define NRFX_UARTE_ENABLED 0 #endif -/** - * @brief NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE - * - * Integer value. Minimum: 0. Maximum: 255. - */ -#ifndef NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE -#define NRFX_UARTE_RX_FIFO_FLUSH_WORKAROUND_MAGIC_BYTE 171 -#endif - /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * From 6db7a7aee2d4116546bf5f617b9d4b1ffe8e7601 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 145/825] Revert "[nrf fromtree] modules: hal_nordic: nrfx: remove nrfx_uarte rx cache for nrf54l15 enga" This reverts commit ae50bc0791c8742fd19d498d26fb43e225af7dac. --- .../nrfx/nrfx_config_nrf54l15_enga_application.h | 9 +++++++++ modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_flpr.h | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_application.h b/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_application.h index 8383b869d71..dcf7cde2de2 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_application.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_application.h @@ -1517,6 +1517,15 @@ #define NRFX_UARTE_CONFIG_TX_LINK 1 #endif +/** + * @brief NRFX_UARTE_CONFIG_RX_CACHE_ENABLED + * + * Boolean. Accepted values: 0 and 1. + */ +#ifndef NRFX_UARTE_CONFIG_RX_CACHE_ENABLED +#define NRFX_UARTE_CONFIG_RX_CACHE_ENABLED 1 +#endif + /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_flpr.h b/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_flpr.h index 729a21606ed..fde8904d9c7 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_flpr.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf54l15_enga_flpr.h @@ -1509,6 +1509,15 @@ #define NRFX_UARTE_CONFIG_TX_LINK 1 #endif +/** + * @brief NRFX_UARTE_CONFIG_RX_CACHE_ENABLED + * + * Boolean. Accepted values: 0 and 1. + */ +#ifndef NRFX_UARTE_CONFIG_RX_CACHE_ENABLED +#define NRFX_UARTE_CONFIG_RX_CACHE_ENABLED 1 +#endif + /** * @brief NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY * From 67ef5a248fc553e678f4c2619e118b576262a700 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 146/825] Revert "[nrf fromtree] manifest: update hal_nordic revision to integrate nrfx 3.6.0" This reverts commit 807115b051fc193982f0ad31d60366ab848e34af. --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 643cb862e52..b77d741b71d 100644 --- a/west.yml +++ b/west.yml @@ -183,7 +183,7 @@ manifest: groups: - hal - name: hal_nordic - revision: d4030afcc0befef645eda11e82c0d7c0e1d604f1 + revision: ab5cb2e2faeb1edfad7a25286dcb513929ae55da path: modules/hal/nordic groups: - hal From 3646f636bd802732dd25156430c4603c58a6dcdb Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 147/825] Revert "[nrf fromlist] tests: drivers: Implement nrf2 clock control api tests" This reverts commit 28b6861211d2d9f54411ff60357a42d84a253600. --- .../nrf2_clock_control/CMakeLists.txt | 9 - .../clock_control/nrf2_clock_control/prj.conf | 6 - .../nrf2_clock_control/src/main.c | 274 ------------------ .../nrf2_clock_control/testcase.yaml | 7 - 4 files changed, 296 deletions(-) delete mode 100644 tests/drivers/clock_control/nrf2_clock_control/CMakeLists.txt delete mode 100644 tests/drivers/clock_control/nrf2_clock_control/prj.conf delete mode 100644 tests/drivers/clock_control/nrf2_clock_control/src/main.c delete mode 100644 tests/drivers/clock_control/nrf2_clock_control/testcase.yaml diff --git a/tests/drivers/clock_control/nrf2_clock_control/CMakeLists.txt b/tests/drivers/clock_control/nrf2_clock_control/CMakeLists.txt deleted file mode 100644 index 66c7f5af222..00000000000 --- a/tests/drivers/clock_control/nrf2_clock_control/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(nrf2_clock_control) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/tests/drivers/clock_control/nrf2_clock_control/prj.conf b/tests/drivers/clock_control/nrf2_clock_control/prj.conf deleted file mode 100644 index 84145cf96a4..00000000000 --- a/tests/drivers/clock_control/nrf2_clock_control/prj.conf +++ /dev/null @@ -1,6 +0,0 @@ -CONFIG_ZTEST=y - -CONFIG_CLOCK_CONTROL_NRF2=y -CONFIG_LOG=y -CONFIG_CLOCK_CONTROL_LOG_LEVEL_DBG=y -CONFIG_LOCAL_DOMAIN_DVFS_LIB_LOG_LEVEL_DBG=y diff --git a/tests/drivers/clock_control/nrf2_clock_control/src/main.c b/tests/drivers/clock_control/nrf2_clock_control/src/main.c deleted file mode 100644 index 60cb9549f3d..00000000000 --- a/tests/drivers/clock_control/nrf2_clock_control/src/main.c +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include - -struct test_clk_context { - const struct device *clk_dev; - const struct nrf_clock_spec *clk_specs; - size_t clk_specs_size; -}; - -const struct nrf_clock_spec test_clk_specs_hsfll[] = { - { - .frequency = MHZ(128), - .accuracy = 0, - .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT, - }, - { - .frequency = MHZ(320), - .accuracy = 0, - .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT, - }, - { - .frequency = MHZ(64), - .accuracy = 0, - .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT, - }, -}; - -#if CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP -const struct nrf_clock_spec test_clk_specs_fll16m[] = { - { - .frequency = MHZ(16), - .accuracy = 20000, - .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT, - }, - { - .frequency = MHZ(16), - .accuracy = 5020, - .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT, - }, - { - .frequency = MHZ(16), - .accuracy = 30, - .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT, - }, -}; - -static const struct test_clk_context fll16m_test_clk_contexts[] = { - { - .clk_dev = DEVICE_DT_GET(DT_NODELABEL(fll16m)), - .clk_specs = test_clk_specs_fll16m, - .clk_specs_size = ARRAY_SIZE(test_clk_specs_fll16m), - }, -}; - -const struct nrf_clock_spec invalid_test_clk_specs_fll16m[] = { - { - .frequency = MHZ(16), - .accuracy = 20, - .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT, - }, - { - .frequency = MHZ(19), - .accuracy = 0, - .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT, - }, - { - .frequency = MHZ(16), - .accuracy = 0, - .precision = NRF_CLOCK_CONTROL_PRECISION_HIGH, - }, -}; - -static const struct test_clk_context invalid_fll16m_test_clk_contexts[] = { - { - .clk_dev = DEVICE_DT_GET(DT_NODELABEL(fll16m)), - .clk_specs = invalid_test_clk_specs_fll16m, - .clk_specs_size = ARRAY_SIZE(invalid_test_clk_specs_fll16m), - }, -}; - -static const struct test_clk_context cpuapp_hsfll_test_clk_contexts[] = { - { - .clk_dev = DEVICE_DT_GET(DT_NODELABEL(cpuapp_hsfll)), - .clk_specs = test_clk_specs_hsfll, - .clk_specs_size = ARRAY_SIZE(test_clk_specs_hsfll), - }, -}; -#elif defined(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD) -static const struct test_clk_context cpurad_hsfll_test_clk_contexts[] = { - { - .clk_dev = DEVICE_DT_GET(DT_NODELABEL(cpurad_hsfll)), - .clk_specs = test_clk_specs_hsfll, - .clk_specs_size = ARRAY_SIZE(test_clk_specs_hsfll), - }, -}; -#endif - -const struct nrf_clock_spec test_clk_specs_lfclk[] = { - { - .frequency = 32768, - .accuracy = 0, - .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT, - }, - { - .frequency = 32768, - .accuracy = 20, - .precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT, - }, - { - .frequency = 32768, - .accuracy = 20, - .precision = NRF_CLOCK_CONTROL_PRECISION_HIGH, - }, -}; - -static const struct test_clk_context lfclk_test_clk_contexts[] = { - { - .clk_dev = DEVICE_DT_GET(DT_NODELABEL(lfclk)), - .clk_specs = test_clk_specs_lfclk, - .clk_specs_size = ARRAY_SIZE(test_clk_specs_lfclk), - }, -}; - -static void test_request_release_clock_spec(const struct device *clk_dev, - const struct nrf_clock_spec *clk_spec) -{ - int ret = 0; - int res = 0; - struct onoff_client cli; - uint32_t rate; - - TC_PRINT("Clock under test: %s\n", clk_dev->name); - sys_notify_init_spinwait(&cli.notify); - ret = nrf_clock_control_request(clk_dev, clk_spec, &cli); - zassert_between_inclusive(ret, 0, 2); - do { - ret = sys_notify_fetch_result(&cli.notify, &res); - k_yield(); - } while (ret == -EAGAIN); - TC_PRINT("Clock control request return value: %d\n", ret); - TC_PRINT("Clock control request response code: %d\n", res); - zassert_ok(ret); - zassert_ok(res); - ret = clock_control_get_rate(clk_dev, NULL, &rate); - zassert_ok(ret); - zassert_equal(rate, clk_spec->frequency); - k_msleep(1000); - ret = nrf_clock_control_release(clk_dev, clk_spec); - zassert_equal(ret, ONOFF_STATE_ON); -} - -static void test_clock_control_request(const struct test_clk_context *clk_contexts, - size_t contexts_size) -{ - const struct test_clk_context *clk_context; - size_t clk_specs_size; - const struct device *clk_dev; - const struct nrf_clock_spec *clk_spec; - - for (size_t i = 0; i < contexts_size; i++) { - clk_context = &clk_contexts[i]; - clk_specs_size = clk_context->clk_specs_size; - - for (size_t u = 0; u < clk_specs_size; u++) { - clk_dev = clk_context->clk_dev; - clk_spec = &clk_context->clk_specs[u]; - - TC_PRINT("Applying clock (%s) spec: frequency %d, accuracy %d, precision " - "%d\n", - clk_dev->name, clk_spec->frequency, clk_spec->accuracy, - clk_spec->precision); - test_request_release_clock_spec(clk_dev, clk_spec); - } - } -} - -#if CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP -ZTEST(nrf2_clock_control, test_cpuapp_hsfll_control) -{ - - TC_PRINT("APPLICATION DOMAIN HSFLL test\n"); - /* Wait for the DVFS init to complete */ - k_msleep(3000); - test_clock_control_request(cpuapp_hsfll_test_clk_contexts, - ARRAY_SIZE(cpuapp_hsfll_test_clk_contexts)); -} - -ZTEST(nrf2_clock_control, test_fll16m_control) -{ - TC_PRINT("FLL16M test\n"); - test_clock_control_request(fll16m_test_clk_contexts, ARRAY_SIZE(fll16m_test_clk_contexts)); -} - -ZTEST(nrf2_clock_control, test_invalid_fll16m_clock_spec_response) -{ - int ret = 0; - int res = 0; - struct onoff_client cli; - const struct test_clk_context *clk_context; - size_t clk_specs_size; - const struct device *clk_dev; - const struct nrf_clock_spec *clk_spec; - - TC_PRINT("FLL16M invalid clock specification test\n"); - - for (size_t i = 0; i < ARRAY_SIZE(invalid_fll16m_test_clk_contexts); i++) { - clk_context = &invalid_fll16m_test_clk_contexts[i]; - clk_specs_size = clk_context->clk_specs_size; - - for (size_t u = 0; u < clk_specs_size; u++) { - clk_dev = clk_context->clk_dev; - clk_spec = &clk_context->clk_specs[u]; - - TC_PRINT("Applying clock (%s) spec: frequency %d, accuracy %d, precision " - "%d\n", - clk_dev->name, clk_spec->frequency, clk_spec->accuracy, - clk_spec->precision); - - sys_notify_init_spinwait(&cli.notify); - ret = nrf_clock_control_request(clk_dev, clk_spec, &cli); - TC_PRINT("Clock control request return value: %d\n", ret); - TC_PRINT("Clock control request response code: %d\n", res); - zassert_equal(ret, -EINVAL); - zassert_ok(res); - } - } -} -#elif defined(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD) -ZTEST(nrf2_clock_control, test_cpurad_hsfll_control) -{ - TC_PRINT("RADIO DOMAIN HSFLL test\n"); - test_clock_control_request(cpurad_hsfll_test_clk_contexts, - ARRAY_SIZE(cpurad_hsfll_test_clk_contexts)); -} -#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)); -} - -ZTEST(nrf2_clock_control, test_safe_request_cancellation) -{ - int ret = 0; - int res = 0; - struct onoff_client cli; - const struct test_clk_context *clk_context = &lfclk_test_clk_contexts[0]; - const struct device *clk_dev = clk_context->clk_dev; - const struct nrf_clock_spec *clk_spec = &test_clk_specs_lfclk[0]; - - TC_PRINT("Safe clock request cancellation\n"); - TC_PRINT("Clock under test: %s\n", clk_dev->name); - sys_notify_init_spinwait(&cli.notify); - ret = nrf_clock_control_request(clk_dev, clk_spec, &cli); - zassert_between_inclusive(ret, 0, 2); - TC_PRINT("Clock control request return value: %d\n", ret); - TC_PRINT("Clock control request response code: %d\n", res); - zassert_ok(res); - ret = nrf_clock_control_cancel_or_release(clk_dev, clk_spec, &cli); - TC_PRINT("Clock control safe cancellation return value: %d\n", ret); - zassert_between_inclusive(ret, ONOFF_STATE_ON, ONOFF_STATE_TO_ON); -} - -ZTEST_SUITE(nrf2_clock_control, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/drivers/clock_control/nrf2_clock_control/testcase.yaml b/tests/drivers/clock_control/nrf2_clock_control/testcase.yaml deleted file mode 100644 index baa1fd15575..00000000000 --- a/tests/drivers/clock_control/nrf2_clock_control/testcase.yaml +++ /dev/null @@ -1,7 +0,0 @@ -tests: - drivers.clock.nrf2_clock_control: - tags: - - drivers - - clock_control - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp From ce5287998a5499d15e84d4c9193a8c73db309984 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 148/825] Revert "[nrf fromlist] samples: boards: nrf: Add nrf2_clock_control sample" This reverts commit 1ec6dda76198f01ff8989991ee480fc191e16a84. --- .../nrf/nrf2_clock_control/CMakeLists.txt | 8 -- samples/boards/nrf/nrf2_clock_control/Kconfig | 24 ----- .../configs/cpuapp_hsfll.conf | 8 -- .../configs/cpuapp_hsfll.overlay | 11 --- .../nrf2_clock_control/configs/fll16m.conf | 8 -- .../nrf2_clock_control/configs/fll16m.overlay | 11 --- .../nrf/nrf2_clock_control/configs/lfclk.conf | 8 -- .../nrf2_clock_control/configs/lfclk.overlay | 11 --- .../nrf2_clock_control/configs/uart135.conf | 8 -- .../configs/uart135.overlay | 15 --- .../boards/nrf/nrf2_clock_control/sample.yaml | 31 ------ .../boards/nrf/nrf2_clock_control/src/main.c | 98 ------------------- 12 files changed, 241 deletions(-) delete mode 100644 samples/boards/nrf/nrf2_clock_control/CMakeLists.txt delete mode 100644 samples/boards/nrf/nrf2_clock_control/Kconfig delete mode 100644 samples/boards/nrf/nrf2_clock_control/configs/cpuapp_hsfll.conf delete mode 100644 samples/boards/nrf/nrf2_clock_control/configs/cpuapp_hsfll.overlay delete mode 100644 samples/boards/nrf/nrf2_clock_control/configs/fll16m.conf delete mode 100644 samples/boards/nrf/nrf2_clock_control/configs/fll16m.overlay delete mode 100644 samples/boards/nrf/nrf2_clock_control/configs/lfclk.conf delete mode 100644 samples/boards/nrf/nrf2_clock_control/configs/lfclk.overlay delete mode 100644 samples/boards/nrf/nrf2_clock_control/configs/uart135.conf delete mode 100644 samples/boards/nrf/nrf2_clock_control/configs/uart135.overlay delete mode 100644 samples/boards/nrf/nrf2_clock_control/sample.yaml delete mode 100644 samples/boards/nrf/nrf2_clock_control/src/main.c diff --git a/samples/boards/nrf/nrf2_clock_control/CMakeLists.txt b/samples/boards/nrf/nrf2_clock_control/CMakeLists.txt deleted file mode 100644 index 36173b99bb2..00000000000 --- a/samples/boards/nrf/nrf2_clock_control/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(nrf_clock_control) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/samples/boards/nrf/nrf2_clock_control/Kconfig b/samples/boards/nrf/nrf2_clock_control/Kconfig deleted file mode 100644 index 9ade1ddad1d..00000000000 --- a/samples/boards/nrf/nrf2_clock_control/Kconfig +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config SAMPLE_CLOCK_FREQUENCY_HZ - int "Frequency specification to request from clock in Hz" - -config SAMPLE_CLOCK_ACCURACY_PPM - int "Accuracy specification to request from clock in PPM" - -config SAMPLE_CLOCK_PRECISION - int "Precision specification to request from clock" - -config SAMPLE_PRE_REQUEST_TIMEOUT - int "Time to wait after boot before requesting clock specs in seconds" - default 2 - help - The distributed clock domains may need time to initialize - before a clock request can be met. - -config SAMPLE_KEEP_REQUEST_TIMEOUT - int "Time to keep request alive in seconds" - default 2 - -source "Kconfig.zephyr" diff --git a/samples/boards/nrf/nrf2_clock_control/configs/cpuapp_hsfll.conf b/samples/boards/nrf/nrf2_clock_control/configs/cpuapp_hsfll.conf deleted file mode 100644 index 5f0cfa6bf9f..00000000000 --- a/samples/boards/nrf/nrf2_clock_control/configs/cpuapp_hsfll.conf +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_CLOCK_CONTROL_NRF2=y - -CONFIG_SAMPLE_CLOCK_FREQUENCY_HZ=320000000 -CONFIG_SAMPLE_CLOCK_ACCURACY_PPM=0 -CONFIG_SAMPLE_CLOCK_PRECISION=0 diff --git a/samples/boards/nrf/nrf2_clock_control/configs/cpuapp_hsfll.overlay b/samples/boards/nrf/nrf2_clock_control/configs/cpuapp_hsfll.overlay deleted file mode 100644 index 651f8567b7a..00000000000 --- a/samples/boards/nrf/nrf2_clock_control/configs/cpuapp_hsfll.overlay +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/{ - aliases { - sample-clock = &cpuapp_hsfll; - }; -}; diff --git a/samples/boards/nrf/nrf2_clock_control/configs/fll16m.conf b/samples/boards/nrf/nrf2_clock_control/configs/fll16m.conf deleted file mode 100644 index 93ccbe945c0..00000000000 --- a/samples/boards/nrf/nrf2_clock_control/configs/fll16m.conf +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_CLOCK_CONTROL_NRF2=y - -CONFIG_SAMPLE_CLOCK_FREQUENCY_HZ=16000000 -CONFIG_SAMPLE_CLOCK_ACCURACY_PPM=30 -CONFIG_SAMPLE_CLOCK_PRECISION=0 diff --git a/samples/boards/nrf/nrf2_clock_control/configs/fll16m.overlay b/samples/boards/nrf/nrf2_clock_control/configs/fll16m.overlay deleted file mode 100644 index 0169c5a2574..00000000000 --- a/samples/boards/nrf/nrf2_clock_control/configs/fll16m.overlay +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/{ - aliases { - sample-clock = &fll16m; - }; -}; diff --git a/samples/boards/nrf/nrf2_clock_control/configs/lfclk.conf b/samples/boards/nrf/nrf2_clock_control/configs/lfclk.conf deleted file mode 100644 index 7752e0fb3db..00000000000 --- a/samples/boards/nrf/nrf2_clock_control/configs/lfclk.conf +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_CLOCK_CONTROL_NRF2=y - -CONFIG_SAMPLE_CLOCK_FREQUENCY_HZ=32768 -CONFIG_SAMPLE_CLOCK_ACCURACY_PPM=20 -CONFIG_SAMPLE_CLOCK_PRECISION=1 diff --git a/samples/boards/nrf/nrf2_clock_control/configs/lfclk.overlay b/samples/boards/nrf/nrf2_clock_control/configs/lfclk.overlay deleted file mode 100644 index 6a04c2de706..00000000000 --- a/samples/boards/nrf/nrf2_clock_control/configs/lfclk.overlay +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/{ - aliases { - sample-clock = &lfclk; - }; -}; diff --git a/samples/boards/nrf/nrf2_clock_control/configs/uart135.conf b/samples/boards/nrf/nrf2_clock_control/configs/uart135.conf deleted file mode 100644 index 93ccbe945c0..00000000000 --- a/samples/boards/nrf/nrf2_clock_control/configs/uart135.conf +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_CLOCK_CONTROL_NRF2=y - -CONFIG_SAMPLE_CLOCK_FREQUENCY_HZ=16000000 -CONFIG_SAMPLE_CLOCK_ACCURACY_PPM=30 -CONFIG_SAMPLE_CLOCK_PRECISION=0 diff --git a/samples/boards/nrf/nrf2_clock_control/configs/uart135.overlay b/samples/boards/nrf/nrf2_clock_control/configs/uart135.overlay deleted file mode 100644 index 0e81f4cd2aa..00000000000 --- a/samples/boards/nrf/nrf2_clock_control/configs/uart135.overlay +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/{ - aliases { - sample-device = &uart135; - }; -}; - -&uart135 { - status = "okay"; -}; diff --git a/samples/boards/nrf/nrf2_clock_control/sample.yaml b/samples/boards/nrf/nrf2_clock_control/sample.yaml deleted file mode 100644 index e0769c26104..00000000000 --- a/samples/boards/nrf/nrf2_clock_control/sample.yaml +++ /dev/null @@ -1,31 +0,0 @@ -sample: - name: nRF2 clock control sample -common: - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - harness: console - harness_config: - type: one_line - regex: - - "clock spec request released" -tests: - sample.boards.nrf.nrf2_clock_control.fll16m: - filter: dt_nodelabel_enabled("fll16m") - extra_args: - - CONF_FILE="configs/fll16m.conf" - - DTC_OVERLAY_FILE="configs/fll16m.overlay" - sample.boards.nrf.nrf2_clock_control.lfclk: - filter: dt_nodelabel_enabled("lfclk") - extra_args: - - CONF_FILE="configs/lfclk.conf" - - DTC_OVERLAY_FILE="configs/lfclk.overlay" - sample.boards.nrf.nrf2_clock_control.uart135: - filter: dt_nodelabel_enabled("uart135") - extra_args: - - CONF_FILE="configs/uart135.conf" - - DTC_OVERLAY_FILE="configs/uart135.overlay" - sample.boards.nrf.nrf2_clock_control.cpuapp_hsfll: - filter: dt_nodelabel_enabled("cpuapp_hsfll") - extra_args: - - CONF_FILE="configs/cpuapp_hsfll.conf" - - DTC_OVERLAY_FILE="configs/cpuapp_hsfll.overlay" diff --git a/samples/boards/nrf/nrf2_clock_control/src/main.c b/samples/boards/nrf/nrf2_clock_control/src/main.c deleted file mode 100644 index 62dd7840e6e..00000000000 --- a/samples/boards/nrf/nrf2_clock_control/src/main.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include - -#if DT_NODE_EXISTS(DT_ALIAS(sample_device)) -#define SAMPLE_CLOCK_NODE DT_CLOCKS_CTLR(DT_ALIAS(sample_device)) -#elif DT_NODE_EXISTS(DT_ALIAS(sample_clock)) -#define SAMPLE_CLOCK_NODE DT_ALIAS(sample_clock) -#endif - -#define SAMPLE_CLOCK_NAME DT_NODE_FULL_NAME(SAMPLE_CLOCK_NODE) - -#define SAMPLE_NOTIFY_TIMEOUT K_SECONDS(2) -#define SAMPLE_PRE_REQUEST_TIMEOUT K_SECONDS(CONFIG_SAMPLE_PRE_REQUEST_TIMEOUT) -#define SAMPLE_KEEP_REQUEST_TIMEOUT K_SECONDS(CONFIG_SAMPLE_KEEP_REQUEST_TIMEOUT) - -const struct device *sample_clock_dev = DEVICE_DT_GET(SAMPLE_CLOCK_NODE); - -static K_SEM_DEFINE(sample_sem, 0, 1); - -static void sample_notify_cb(void) -{ - k_sem_give(&sample_sem); -} - -int main(void) -{ - struct onoff_client cli; - int ret; - int res; - int64_t req_start_uptime; - int64_t req_stop_uptime; - - printk("\n"); - printk("clock name: %s\n", SAMPLE_CLOCK_NAME); - printk("minimum frequency request: %uHz\n", CONFIG_SAMPLE_CLOCK_FREQUENCY_HZ); - printk("minimum accuracy request: %uPPM\n", CONFIG_SAMPLE_CLOCK_ACCURACY_PPM); - printk("minimum precision request: %u\n", CONFIG_SAMPLE_CLOCK_PRECISION); - - 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); - - k_sleep(SAMPLE_PRE_REQUEST_TIMEOUT); - - printk("\n"); - printk("requesting minimum clock specs\n"); - req_start_uptime = k_uptime_get(); - ret = nrf_clock_control_request(sample_clock_dev, &spec, &cli); - if (ret < 0) { - printk("minimum clock specs could not be met\n"); - return 0; - } - - ret = k_sem_take(&sample_sem, SAMPLE_NOTIFY_TIMEOUT); - if (ret < 0) { - printk("timed out waiting for clock to meet request\n"); - return 0; - } - - req_stop_uptime = k_uptime_get(); - - ret = sys_notify_fetch_result(&cli.notify, &res); - if (ret < 0) { - printk("sys notify fetch failed\n"); - return 0; - } - - if (res < 0) { - printk("failed to apply request to clock\n"); - return 0; - } - - printk("request applied to clock in %llims\n", req_stop_uptime - req_start_uptime); - k_sleep(SAMPLE_KEEP_REQUEST_TIMEOUT); - - printk("\n"); - printk("releasing requested clock specs\n"); - ret = nrf_clock_control_release(sample_clock_dev, &spec); - if (ret < 0) { - printk("failed to release requested clock specs\n"); - return 0; - } - - printk("clock spec request released\n"); - return 0; -} From da962c5a468a4bcbdd43d033ff87e61d4a49582e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 149/825] Revert "[nrf fromlist] drivers: clock_control: Add support for nRF54H20 clock controllers" This reverts commit 0c0eacb800fe6915aca7f07a9b2c071aae63f905. --- drivers/clock_control/CMakeLists.txt | 7 - drivers/clock_control/Kconfig.nrf | 21 -- .../clock_control/clock_control_nrf2_common.c | 198 ------------- .../clock_control/clock_control_nrf2_common.h | 89 ------ .../clock_control/clock_control_nrf2_fll16m.c | 262 ----------------- .../clock_control/clock_control_nrf2_hfxo.c | 196 ------------- .../clock_control/clock_control_nrf2_hsfll.c | 237 ---------------- .../clock_control/clock_control_nrf2_lfclk.c | 264 ------------------ .../drivers/clock_control/nrf_clock_control.h | 143 ---------- soc/nordic/Kconfig.defconfig | 2 +- 10 files changed, 1 insertion(+), 1418 deletions(-) delete mode 100644 drivers/clock_control/clock_control_nrf2_common.c delete mode 100644 drivers/clock_control/clock_control_nrf2_common.h delete mode 100644 drivers/clock_control/clock_control_nrf2_fll16m.c delete mode 100644 drivers/clock_control/clock_control_nrf2_hfxo.c delete mode 100644 drivers/clock_control/clock_control_nrf2_hsfll.c delete mode 100644 drivers/clock_control/clock_control_nrf2_lfclk.c diff --git a/drivers/clock_control/CMakeLists.txt b/drivers/clock_control/CMakeLists.txt index f0af584a08c..949d87d1a66 100644 --- a/drivers/clock_control/CMakeLists.txt +++ b/drivers/clock_control/CMakeLists.txt @@ -31,13 +31,6 @@ zephyr_library_sources_ifdef(CONFIG_CLOCK_CONTROL_AMBIQ clock_cont 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) -if(CONFIG_CLOCK_CONTROL_NRF2) - zephyr_library_sources(clock_control_nrf2_common.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_STM32_CUBE) zephyr_library_sources_ifdef(CONFIG_CLOCK_STM32_MUX clock_stm32_mux.c) diff --git a/drivers/clock_control/Kconfig.nrf b/drivers/clock_control/Kconfig.nrf index c717cb37103..8b30772f26c 100644 --- a/drivers/clock_control/Kconfig.nrf +++ b/drivers/clock_control/Kconfig.nrf @@ -172,24 +172,3 @@ config CLOCK_CONTROL_NRF_ACCURACY default 20 if CLOCK_CONTROL_NRF_K32SRC_20PPM endif # CLOCK_CONTROL_NRF - -config CLOCK_CONTROL_NRF2 - bool "nRF clock control support" - depends on SOC_SERIES_NRF54HX && !RISCV_CORE_NORDIC_VPR - select ONOFF - select NRFS if HAS_NRFS - imply NRFS_LOCAL_DOMAIN_DVFS_SCALE_DOWN_AFTER_INIT if NRFS_DVFS_LOCAL_DOMAIN - help - Support for nRF clock control devices. - -if CLOCK_CONTROL_NRF2 - -config CLOCK_CONTROL_NRF2_NRFS_DVFS_TIMEOUT_MS - int "Timeout waiting for nrfs dvfs service callback in milliseconds" - default 2000 - -config CLOCK_CONTROL_NRF2_NRFS_CLOCK_TIMEOUT_MS - int "Timeout waiting for nrfs clock service callback in milliseconds" - default 1000 - -endif # CLOCK_CONTROL_NRF2 diff --git a/drivers/clock_control/clock_control_nrf2_common.c b/drivers/clock_control/clock_control_nrf2_common.c deleted file mode 100644 index 469c39a100b..00000000000 --- a/drivers/clock_control/clock_control_nrf2_common.c +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "clock_control_nrf2_common.h" -#include -#include - -#include -LOG_MODULE_REGISTER(clock_control_nrf2, CONFIG_CLOCK_CONTROL_LOG_LEVEL); - -#define FLAG_UPDATE_IN_PROGRESS BIT(FLAGS_COMMON_BITS - 1) -#define FLAG_UPDATE_NEEDED BIT(FLAGS_COMMON_BITS - 2) - -#define ONOFF_CNT_MAX (FLAGS_COMMON_BITS - 2) - -#define CONTAINER_OF_ITEM(ptr, idx, type, array) \ - (type *)((char *)ptr - \ - (idx * sizeof(array[0])) - \ - offsetof(type, array[0])) - -/* - * Definition of `struct clock_config_generic`. - * Used to access `clock_config_*` structures in a common way. - */ -NRF2_STRUCT_CLOCK_CONFIG(generic, ONOFF_CNT_MAX); - -static sys_slist_t poweron_main_list; -static struct k_spinlock poweron_main_lock; - -static void update_config(struct clock_config_generic *cfg) -{ - atomic_val_t prev_flags = atomic_or(&cfg->flags, FLAG_UPDATE_NEEDED); - - /* If the update work is already scheduled (FLAG_UPDATE_NEEDED was - * set before the above OR operation) or is currently being executed, - * it is not to be submitted again. In the latter case, it will be - * submitted by nrf2_clock_config_update_end(). - */ - if (prev_flags & (FLAG_UPDATE_NEEDED | FLAG_UPDATE_IN_PROGRESS)) { - return; - } - - k_work_submit(&cfg->work); -} - -static void onoff_start_option(struct onoff_manager *mgr, - onoff_notify_fn notify) -{ - struct clock_onoff *onoff = - CONTAINER_OF(mgr, struct clock_onoff, mgr); - struct clock_config_generic *cfg = - CONTAINER_OF_ITEM(onoff, onoff->idx, - struct clock_config_generic, onoff); - - onoff->notify = notify; - - (void)atomic_or(&cfg->flags, BIT(onoff->idx)); - update_config(cfg); -} - -static void onoff_stop_option(struct onoff_manager *mgr, - onoff_notify_fn notify) -{ - struct clock_onoff *onoff = - CONTAINER_OF(mgr, struct clock_onoff, mgr); - struct clock_config_generic *cfg = - CONTAINER_OF_ITEM(onoff, onoff->idx, - struct clock_config_generic, onoff); - - (void)atomic_and(&cfg->flags, ~BIT(onoff->idx)); - update_config(cfg); - - notify(mgr, 0); -} - -static inline uint8_t get_index_of_highest_bit(uint32_t value) -{ - return value ? (uint8_t)(31 - __builtin_clz(value)) : 0; -} - -int nrf2_clock_config_init(void *clk_cfg, uint8_t onoff_cnt, - k_work_handler_t update_work_handler) -{ - struct clock_config_generic *cfg = clk_cfg; - - __ASSERT_NO_MSG(onoff_cnt <= ONOFF_CNT_MAX); - - for (int i = 0; i < onoff_cnt; ++i) { - static const struct onoff_transitions transitions = { - .start = onoff_start_option, - .stop = onoff_stop_option - }; - int rc; - - rc = onoff_manager_init(&cfg->onoff[i].mgr, &transitions); - if (rc < 0) { - return rc; - } - - cfg->onoff[i].idx = (uint8_t)i; - } - - cfg->onoff_cnt = onoff_cnt; - - k_work_init(&cfg->work, update_work_handler); - - return 0; -} - -uint8_t nrf2_clock_config_update_begin(struct k_work *work) -{ - struct clock_config_generic *cfg = - CONTAINER_OF(work, struct clock_config_generic, work); - uint32_t active_options; - - (void)atomic_or(&cfg->flags, FLAG_UPDATE_IN_PROGRESS); - cfg->flags_snapshot = atomic_and(&cfg->flags, ~FLAG_UPDATE_NEEDED); - - active_options = cfg->flags_snapshot & BIT_MASK(ONOFF_CNT_MAX); - return get_index_of_highest_bit(active_options); -} - -void nrf2_clock_config_update_end(void *clk_cfg, int status) -{ - struct clock_config_generic *cfg = clk_cfg; - atomic_val_t prev_flags; - - prev_flags = atomic_and(&cfg->flags, ~FLAG_UPDATE_IN_PROGRESS); - if (!(prev_flags & FLAG_UPDATE_IN_PROGRESS)) { - return; - } - - for (int i = 0; i < cfg->onoff_cnt; ++i) { - if (cfg->flags_snapshot & BIT(i)) { - onoff_notify_fn notify = cfg->onoff[i].notify; - - if (notify) { - /* If an option was to be activated now - * (it is waiting for a notification) and - * the activation failed, this option's flag - * must be cleared (the option can no longer - * be considered active). - */ - if (status < 0) { - (void)atomic_and(&cfg->flags, ~BIT(i)); - } - - cfg->onoff[i].notify = NULL; - notify(&cfg->onoff[i].mgr, status); - } - } - } - - if (prev_flags & FLAG_UPDATE_NEEDED) { - k_work_submit(&cfg->work); - } -} - -int api_nosys_on_off(const struct device *dev, clock_control_subsys_t sys) -{ - ARG_UNUSED(dev); - ARG_UNUSED(sys); - - return -ENOSYS; -} - -void nrf2_clock_request_lrcconf_poweron_main(struct nrf2_clock_lrcconf_sink *sink) -{ - K_SPINLOCK(&poweron_main_lock) { - if (sys_slist_len(&poweron_main_list) == 0) { - LOG_DBG("%s forced on", "main domain"); - NRF_LRCCONF010->POWERON &= ~LRCCONF_POWERON_MAIN_Msk; - NRF_LRCCONF010->POWERON |= LRCCONF_POWERON_MAIN_AlwaysOn; - } - - sys_slist_find_and_remove(&poweron_main_list, &sink->node); - sys_slist_append(&poweron_main_list, &sink->node); - } -} - -void nrf2_clock_release_lrcconf_poweron_main(struct nrf2_clock_lrcconf_sink *sink) -{ - K_SPINLOCK(&poweron_main_lock) { - if (!sys_slist_find_and_remove(&poweron_main_list, &sink->node)) { - K_SPINLOCK_BREAK; - } - - if (sys_slist_len(&poweron_main_list) > 0) { - K_SPINLOCK_BREAK; - } - - LOG_DBG("%s automatic", "main domain"); - NRF_LRCCONF010->POWERON &= ~LRCCONF_POWERON_MAIN_Msk; - NRF_LRCCONF010->POWERON |= LRCCONF_POWERON_MAIN_Automatic; - } -} diff --git a/drivers/clock_control/clock_control_nrf2_common.h b/drivers/clock_control/clock_control_nrf2_common.h deleted file mode 100644 index 4a153216cda..00000000000 --- a/drivers/clock_control/clock_control_nrf2_common.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_DRIVERS_CLOCK_CONTROL_NRF2_COMMON_H_ -#define ZEPHYR_DRIVERS_CLOCK_CONTROL_NRF2_COMMON_H_ - -#include -#include -#include -#include -#include - -#define FLAGS_COMMON_BITS 10 - -struct clock_onoff { - struct onoff_manager mgr; - onoff_notify_fn notify; - uint8_t idx; -}; - -/** - * @brief Defines a type for specific clock configuration structure. - * - * @param type suffix added clock_config_ to form the type name. - * @param _onoff_cnt number of clock configuration options to be handled; - * for each one a separate onoff manager instance is used. - */ -#define NRF2_STRUCT_CLOCK_CONFIG(type, _onoff_cnt) \ - struct clock_config_##type { \ - atomic_t flags; \ - uint32_t flags_snapshot; \ - struct k_work work; \ - uint8_t onoff_cnt; \ - struct clock_onoff onoff[_onoff_cnt]; \ - } - -/** - * @brief Initializes a clock configuration structure. - * - * @param clk_cfg pointer to the structure to be initialized. - * @param onoff_cnt number of clock configuration options handled - * handled by the structure. - * @param update_work_handler function that performs configuration update, - * called from the system work queue. - * - * @return 0 on success, negative value when onoff initialization fails. - */ -int nrf2_clock_config_init(void *clk_cfg, uint8_t onoff_cnt, - k_work_handler_t update_work_handler); - -/** - * @brief Starts a clock configuration update. - * - * This function is supposed to be called by a specific clock control driver - * from its update work handler. - * - * @param work pointer to the work item received by the update work handler. - * - * @return index of the clock configuration onoff option to be activated. - */ -uint8_t nrf2_clock_config_update_begin(struct k_work *work); - -/** - * @brief Finalizes a clock configuration update. - * - * Notifies all relevant onoff managers about the update result. - * Only the first call after each nrf2_clock_config_update_begin() performs - * the actual operation. Any further calls are simply no-ops. - * - * @param clk_cfg pointer to the clock configuration structure. - * @param status result to be passed to onoff managers. - */ -void nrf2_clock_config_update_end(void *clk_cfg, int status); - -int api_nosys_on_off(const struct device *dev, clock_control_subsys_t sys); - -struct nrf2_clock_lrcconf_sink { - sys_snode_t node; -}; - -/** - * @brief Request or release lrcconf main power domain - */ -void nrf2_clock_request_lrcconf_poweron_main(struct nrf2_clock_lrcconf_sink *sink); -void nrf2_clock_release_lrcconf_poweron_main(struct nrf2_clock_lrcconf_sink *sink); - -#endif /* ZEPHYR_DRIVERS_CLOCK_CONTROL_NRF2_COMMON_H_ */ diff --git a/drivers/clock_control/clock_control_nrf2_fll16m.c b/drivers/clock_control/clock_control_nrf2_fll16m.c deleted file mode 100644 index 2ad0c773831..00000000000 --- a/drivers/clock_control/clock_control_nrf2_fll16m.c +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#define DT_DRV_COMPAT nordic_nrf_fll16m - -#include "clock_control_nrf2_common.h" -#include -#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"); - -#define FLAG_HFXO_STARTED BIT(FLAGS_COMMON_BITS) - -#define FLL16M_MODE_OPEN_LOOP 0 -#define FLL16M_MODE_CLOSED_LOOP 1 -#define FLL16M_MODE_BYPASS 2 -#define FLL16M_MODE_DEFAULT FLL16M_MODE_OPEN_LOOP - -#define FLL16M_LFXO_NODE DT_INST_PHANDLE_BY_NAME(0, clocks, lfxo) -#define FLL16M_HFXO_NODE DT_INST_PHANDLE_BY_NAME(0, clocks, hfxo) - -#define FLL16M_HAS_LFXO DT_NODE_HAS_STATUS(FLL16M_LFXO_NODE, okay) - -#define FLL16M_LFXO_ACCURACY DT_PROP(FLL16M_LFXO_NODE, accuracy_ppm) -#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_CLOSED_LOOP_BASE_ACCURACY DT_INST_PROP(0, closed_loop_base_accuracy_ppm) -#define FLL16M_MAX_ACCURACY FLL16M_HFXO_ACCURACY - -/* Closed-loop mode uses LFXO as source if present, HFXO otherwise */ -#if FLL16M_HAS_LFXO -#define FLL16M_CLOSED_LOOP_ACCURACY (FLL16M_CLOSED_LOOP_BASE_ACCURACY + FLL16M_LFXO_ACCURACY) -#else -#define FLL16M_CLOSED_LOOP_ACCURACY (FLL16M_CLOSED_LOOP_BASE_ACCURACY + FLL16M_HFXO_ACCURACY) -#endif - -/* Clock options sorted from lowest to highest accuracy */ -static const struct clock_options { - uint16_t accuracy; - uint8_t mode; -} clock_options[] = { - { - .accuracy = FLL16M_OPEN_LOOP_ACCURACY, - .mode = FLL16M_MODE_OPEN_LOOP, - }, - { - .accuracy = FLL16M_CLOSED_LOOP_ACCURACY, - .mode = FLL16M_MODE_CLOSED_LOOP, - }, - { - /* Bypass mode uses HFXO */ - .accuracy = FLL16M_HFXO_ACCURACY, - .mode = FLL16M_MODE_BYPASS, - }, -}; - -struct fll16m_dev_data { - NRF2_STRUCT_CLOCK_CONFIG(fll16m, ARRAY_SIZE(clock_options)) clk_cfg; - struct onoff_client hfxo_cli; - struct nrf2_clock_lrcconf_sink lrcconf_sink; -}; - -struct fll16m_dev_config { - uint32_t fixed_frequency; -}; - -static void activate_fll16m_mode(struct fll16m_dev_data *dev_data, uint8_t mode) -{ - /* TODO: change to nrf_lrcconf_* function when such is available. */ - - if (mode != FLL16M_MODE_DEFAULT) { - nrf2_clock_request_lrcconf_poweron_main(&dev_data->lrcconf_sink); - } - - NRF_LRCCONF010->CLKCTRL[0].SRC = mode; - - if (mode == FLL16M_MODE_DEFAULT) { - nrf2_clock_release_lrcconf_poweron_main(&dev_data->lrcconf_sink); - } - - nrf_lrcconf_task_trigger(NRF_LRCCONF010, NRF_LRCCONF_TASK_CLKSTART_0); - - nrf2_clock_config_update_end(&dev_data->clk_cfg, 0); -} - -static void hfxo_cb(struct onoff_manager *mgr, - struct onoff_client *cli, - uint32_t state, - int res) -{ - ARG_UNUSED(mgr); - ARG_UNUSED(state); - - struct fll16m_dev_data *dev_data = - CONTAINER_OF(cli, struct fll16m_dev_data, hfxo_cli); - - if (res < 0) { - nrf2_clock_config_update_end(&dev_data->clk_cfg, res); - } else { - (void)atomic_or(&dev_data->clk_cfg.flags, FLAG_HFXO_STARTED); - - activate_fll16m_mode(dev_data, FLL16M_MODE_BYPASS); - } -} - -static void fll16m_work_handler(struct k_work *work) -{ - const struct device *hfxo = DEVICE_DT_GET(FLL16M_HFXO_NODE); - struct fll16m_dev_data *dev_data = - CONTAINER_OF(work, struct fll16m_dev_data, clk_cfg.work); - uint8_t to_activate_idx; - - to_activate_idx = nrf2_clock_config_update_begin(work); - if (clock_options[to_activate_idx].mode == FLL16M_MODE_BYPASS) { - int rc; - - /* Bypass mode requires HFXO to be running first. */ - sys_notify_init_callback(&dev_data->hfxo_cli.notify, hfxo_cb); - rc = nrf_clock_control_request(hfxo, NULL, &dev_data->hfxo_cli); - if (rc < 0) { - nrf2_clock_config_update_end(&dev_data->clk_cfg, rc); - } - } else { - atomic_val_t prev_flags; - - prev_flags = atomic_and(&dev_data->clk_cfg.flags, - ~FLAG_HFXO_STARTED); - if (prev_flags & FLAG_HFXO_STARTED) { - (void)nrf_clock_control_release(hfxo, NULL); - } - - activate_fll16m_mode(dev_data, - clock_options[to_activate_idx].mode); - } -} - -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 accuracy; - - if (!spec) { - return &dev_data->clk_cfg.onoff[0].mgr; - } - - if (spec->frequency > dev_config->fixed_frequency) { - LOG_ERR("invalid frequency"); - return NULL; - } - - if (spec->precision) { - LOG_ERR("invalid precision"); - return NULL; - } - - accuracy = spec->accuracy == NRF_CLOCK_CONTROL_ACCURACY_MAX - ? FLL16M_MAX_ACCURACY - : spec->accuracy; - - for (int i = 0; i < ARRAY_SIZE(clock_options); ++i) { - if (accuracy && - accuracy < clock_options[i].accuracy) { - continue; - } - - return &dev_data->clk_cfg.onoff[i].mgr; - } - - LOG_ERR("invalid accuracy"); - 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(dev, spec); - - if (mgr) { - return onoff_request(mgr, cli); - } - - return -EINVAL; -} - -static int api_release_fll16m(const struct device *dev, - const struct nrf_clock_spec *spec) -{ - struct onoff_manager *mgr = fll16m_find_mgr(dev, spec); - - if (mgr) { - return onoff_release(mgr); - } - - return -EINVAL; -} - -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(dev, spec); - - if (mgr) { - return onoff_cancel_or_release(mgr, cli); - } - - return -EINVAL; -} - -static int api_get_rate_fll16m(const struct device *dev, - clock_control_subsys_t sys, - uint32_t *rate) -{ - ARG_UNUSED(sys); - - const struct fll16m_dev_config *dev_config = dev->config; - - *rate = dev_config->fixed_frequency; - - return 0; -} - -static int fll16m_init(const struct device *dev) -{ - struct fll16m_dev_data *dev_data = dev->data; - - return nrf2_clock_config_init(&dev_data->clk_cfg, - ARRAY_SIZE(dev_data->clk_cfg.onoff), - fll16m_work_handler); -} - -static struct nrf_clock_control_driver_api fll16m_drv_api = { - .std_api = { - .on = api_nosys_on_off, - .off = api_nosys_on_off, - .get_rate = api_get_rate_fll16m, - }, - .request = api_request_fll16m, - .release = api_release_fll16m, - .cancel_or_release = api_cancel_or_release_fll16m, -}; - -static struct fll16m_dev_data fll16m_data; - -static const struct fll16m_dev_config fll16m_config = { - .fixed_frequency = DT_INST_PROP(0, clock_frequency), -}; - -DEVICE_DT_INST_DEFINE(0, fll16m_init, NULL, - &fll16m_data, &fll16m_config, - PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, - &fll16m_drv_api); diff --git a/drivers/clock_control/clock_control_nrf2_hfxo.c b/drivers/clock_control/clock_control_nrf2_hfxo.c deleted file mode 100644 index 1abe0c0cd67..00000000000 --- a/drivers/clock_control/clock_control_nrf2_hfxo.c +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#define DT_DRV_COMPAT nordic_nrf54h_hfxo - -#include "clock_control_nrf2_common.h" -#include -#include -#include -LOG_MODULE_DECLARE(clock_control_nrf2, CONFIG_CLOCK_CONTROL_LOG_LEVEL); - -#include - -BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1, - "multiple instances not supported"); - -struct dev_data_hfxo { - struct onoff_manager mgr; - onoff_notify_fn notify; - struct k_timer timer; - struct nrf2_clock_lrcconf_sink lrcconf_sink; -}; - -struct dev_config_hfxo { - uint32_t fixed_frequency; - uint16_t fixed_accuracy; - k_timeout_t start_up_time; -}; - -static void hfxo_start_up_timer_handler(struct k_timer *timer) -{ - struct dev_data_hfxo *dev_data = - CONTAINER_OF(timer, struct dev_data_hfxo, timer); - - /* In specific cases, the HFXOSTARTED event might not be set even - * though the HFXO has started (this is a hardware issue that will - * be fixed). For now, the HFXO is simply assumed to be started - * after its configured start-up time expires. - */ - LOG_DBG("HFXOSTARTED: %u", - nrf_lrcconf_event_check(NRF_LRCCONF010, - NRF_LRCCONF_EVENT_HFXOSTARTED)); - - if (dev_data->notify) { - dev_data->notify(&dev_data->mgr, 0); - } -} - -static void onoff_start_hfxo(struct onoff_manager *mgr, onoff_notify_fn notify) -{ - struct dev_data_hfxo *dev_data = - CONTAINER_OF(mgr, struct dev_data_hfxo, mgr); - const struct device *dev = DEVICE_DT_INST_GET(0); - const struct dev_config_hfxo *dev_config = dev->config; - - dev_data->notify = notify; - - nrf_lrcconf_event_clear(NRF_LRCCONF010, NRF_LRCCONF_EVENT_HFXOSTARTED); - nrf2_clock_request_lrcconf_poweron_main(&dev_data->lrcconf_sink); - nrf_lrcconf_task_trigger(NRF_LRCCONF010, NRF_LRCCONF_TASK_REQHFXO); - - /* Due to a hardware issue, the HFXOSTARTED event is currently - * unreliable. Hence the timer is used to simply wait the expected - * start-up time. To be removed once the hardware is fixed. - */ - k_timer_start(&dev_data->timer, dev_config->start_up_time, K_NO_WAIT); -} - -static void onoff_stop_hfxo(struct onoff_manager *mgr, onoff_notify_fn notify) -{ - struct dev_data_hfxo *dev_data = - CONTAINER_OF(mgr, struct dev_data_hfxo, mgr); - - nrf_lrcconf_task_trigger(NRF_LRCCONF010, NRF_LRCCONF_TASK_STOPREQHFXO); - nrf2_clock_release_lrcconf_poweron_main(&dev_data->lrcconf_sink); - notify(mgr, 0); -} - -static bool is_clock_spec_valid(const struct device *dev, - const struct nrf_clock_spec *spec) -{ - const struct dev_config_hfxo *dev_config = dev->config; - - if (spec->frequency > dev_config->fixed_frequency) { - LOG_ERR("invalid frequency"); - return false; - } - - /* Signal an error if an accuracy better than available is requested. */ - if (spec->accuracy && - spec->accuracy != NRF_CLOCK_CONTROL_ACCURACY_MAX && - spec->accuracy < dev_config->fixed_accuracy) { - LOG_ERR("invalid accuracy"); - return false; - } - - /* Consider HFXO precision high, skip checking what is requested. */ - - return true; -} - -static int api_request_hfxo(const struct device *dev, - const struct nrf_clock_spec *spec, - struct onoff_client *cli) -{ - struct dev_data_hfxo *dev_data = dev->data; - - if (spec && !is_clock_spec_valid(dev, spec)) { - return -EINVAL; - } - - return onoff_request(&dev_data->mgr, cli); -} - -static int api_release_hfxo(const struct device *dev, - const struct nrf_clock_spec *spec) -{ - struct dev_data_hfxo *dev_data = dev->data; - - if (spec && !is_clock_spec_valid(dev, spec)) { - return -EINVAL; - } - - return onoff_release(&dev_data->mgr); -} - -static int api_cancel_or_release_hfxo(const struct device *dev, - const struct nrf_clock_spec *spec, - struct onoff_client *cli) -{ - struct dev_data_hfxo *dev_data = dev->data; - - if (spec && !is_clock_spec_valid(dev, spec)) { - return -EINVAL; - } - - return onoff_cancel_or_release(&dev_data->mgr, cli); -} - -static int api_get_rate_hfxo(const struct device *dev, - clock_control_subsys_t sys, - uint32_t *rate) -{ - ARG_UNUSED(sys); - - const struct dev_config_hfxo *dev_config = dev->config; - - *rate = dev_config->fixed_frequency; - - return 0; -} - -static int init_hfxo(const struct device *dev) -{ - struct dev_data_hfxo *dev_data = dev->data; - static const struct onoff_transitions transitions = { - .start = onoff_start_hfxo, - .stop = onoff_stop_hfxo - }; - int rc; - - rc = onoff_manager_init(&dev_data->mgr, &transitions); - if (rc < 0) { - return rc; - } - - k_timer_init(&dev_data->timer, hfxo_start_up_timer_handler, NULL); - - return 0; -} - -static struct nrf_clock_control_driver_api drv_api_hfxo = { - .std_api = { - .on = api_nosys_on_off, - .off = api_nosys_on_off, - .get_rate = api_get_rate_hfxo, - }, - .request = api_request_hfxo, - .release = api_release_hfxo, - .cancel_or_release = api_cancel_or_release_hfxo, -}; - -static struct dev_data_hfxo data_hfxo; - -static const struct dev_config_hfxo config_hfxo = { - .fixed_frequency = DT_INST_PROP(0, clock_frequency), - .fixed_accuracy = DT_INST_PROP(0, accuracy_ppm), - .start_up_time = K_USEC(DT_INST_PROP(0, startup_time_us)), -}; - -DEVICE_DT_INST_DEFINE(0, init_hfxo, NULL, - &data_hfxo, &config_hfxo, - PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, - &drv_api_hfxo); diff --git a/drivers/clock_control/clock_control_nrf2_hsfll.c b/drivers/clock_control/clock_control_nrf2_hsfll.c deleted file mode 100644 index 1ae21be1cf4..00000000000 --- a/drivers/clock_control/clock_control_nrf2_hsfll.c +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#define DT_DRV_COMPAT nordic_nrf_hsfll - -#include "clock_control_nrf2_common.h" -#include -#include -#include - -#include -LOG_MODULE_DECLARE(clock_control_nrf2, CONFIG_CLOCK_CONTROL_LOG_LEVEL); - -/* TODO: add support for other HSFLLs */ -BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1, - "multiple instances not supported"); - -#ifdef CONFIG_NRFS_HAS_DVFS_SERVICE -#include - -#define FLAG_FREQ_CHANGE_CB_EXPECTED BIT(FLAGS_COMMON_BITS) - -#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 { - uint32_t frequency; - enum dvfs_frequency_setting setting; -} clock_options[] = { - { - .frequency = MHZ(64), - .setting = DVFS_FREQ_LOW, - }, - { - .frequency = MHZ(128), - .setting = DVFS_FREQ_MEDLOW, - }, - { - .frequency = MHZ(320), - .setting = DVFS_FREQ_HIGH, - }, -}; - -struct hsfll_dev_data { - NRF2_STRUCT_CLOCK_CONFIG(hsfll, ARRAY_SIZE(clock_options)) clk_cfg; - struct k_timer timer; -}; - -static void freq_setting_applied_cb(enum dvfs_frequency_setting new_setting) -{ - ARG_UNUSED(new_setting); - - const struct device *dev = DEVICE_DT_INST_GET(0); - struct hsfll_dev_data *dev_data = dev->data; - atomic_val_t prev_flags; - - /* Process only expected notifications (after sent requests). */ - prev_flags = atomic_and(&dev_data->clk_cfg.flags, - ~FLAG_FREQ_CHANGE_CB_EXPECTED); - if (prev_flags & FLAG_FREQ_CHANGE_CB_EXPECTED) { - k_timer_stop(&dev_data->timer); - - nrf2_clock_config_update_end(&dev_data->clk_cfg, 0); - } -} - -static void hsfll_update_timeout_handler(struct k_timer *timer) -{ - struct hsfll_dev_data *dev_data = - CONTAINER_OF(timer, struct hsfll_dev_data, timer); - - nrf2_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 dvfs_frequency_setting required_setting; - uint8_t to_activate_idx; - int rc; - - to_activate_idx = nrf2_clock_config_update_begin(work); - required_setting = clock_options[to_activate_idx].setting; - - /* Notify the DVFS service about the required setting. */ - rc = dvfs_service_handler_change_freq_setting(required_setting); - if (rc < 0) { - nrf2_clock_config_update_end(&dev_data->clk_cfg, rc); - return; - } - - /* And expect a confirmation that the setting is ready to be used. */ - (void)atomic_or(&dev_data->clk_cfg.flags, FLAG_FREQ_CHANGE_CB_EXPECTED); - k_timer_start(&dev_data->timer, NRFS_DVFS_TIMEOUT, K_NO_WAIT); -} - -static struct onoff_manager *hsfll_find_mgr(const struct device *dev, - const struct nrf_clock_spec *spec) -{ - struct hsfll_dev_data *dev_data = dev->data; - uint32_t frequency; - - if (!spec) { - return &dev_data->clk_cfg.onoff[0].mgr; - } - - if (spec->accuracy || spec->precision) { - LOG_ERR("invalid specification of accuracy or precision"); - return NULL; - } - - frequency = spec->frequency == NRF_CLOCK_CONTROL_FREQUENCY_MAX - ? MHZ(320) - : spec->frequency; - - for (int i = 0; i < ARRAY_SIZE(clock_options); ++i) { - if (frequency > clock_options[i].frequency) { - continue; - } - - return &dev_data->clk_cfg.onoff[i].mgr; - } - - LOG_ERR("invalid frequency"); - return NULL; -} -#endif /* CONFIG_NRFS_HAS_DVFS_SERVICE */ - -static int api_request_hsfll(const struct device *dev, - const struct nrf_clock_spec *spec, - struct onoff_client *cli) -{ -#ifdef CONFIG_NRFS_HAS_DVFS_SERVICE - struct onoff_manager *mgr = hsfll_find_mgr(dev, spec); - - if (mgr) { - return onoff_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_NRFS_HAS_DVFS_SERVICE - struct onoff_manager *mgr = hsfll_find_mgr(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_NRFS_HAS_DVFS_SERVICE - struct onoff_manager *mgr = hsfll_find_mgr(dev, spec); - - if (mgr) { - return onoff_cancel_or_release(mgr, cli); - } - - return -EINVAL; -#else - return -ENOTSUP; -#endif -} - -static int api_get_rate_hsfll(const struct device *dev, - clock_control_subsys_t sys, - uint32_t *rate) -{ - ARG_UNUSED(dev); - ARG_UNUSED(sys); - - *rate = nrf_hsfll_clkctrl_mult_get(NRF_HSFLL) * MHZ(16); - - return 0; -} - -static int hsfll_init(const struct device *dev) -{ -#ifdef CONFIG_NRFS_HAS_DVFS_SERVICE - struct hsfll_dev_data *dev_data = dev->data; - int rc; - - rc = nrf2_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); - - dvfs_service_handler_register_freq_setting_applied_callback( - freq_setting_applied_cb); -#endif - - return 0; -} - -static struct nrf_clock_control_driver_api hsfll_drv_api = { - .std_api = { - .on = api_nosys_on_off, - .off = api_nosys_on_off, - .get_rate = api_get_rate_hsfll, - }, - .request = api_request_hsfll, - .release = api_release_hsfll, - .cancel_or_release = api_cancel_or_release_hsfll, -}; - -#ifdef CONFIG_NRFS_HAS_DVFS_SERVICE -static struct hsfll_dev_data hsfll_data; -#endif - -DEVICE_DT_INST_DEFINE(0, hsfll_init, NULL, - COND_CODE_1(CONFIG_NRFS_HAS_DVFS_SERVICE, - (&hsfll_data), - (NULL)), - NULL, - PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, - &hsfll_drv_api); diff --git a/drivers/clock_control/clock_control_nrf2_lfclk.c b/drivers/clock_control/clock_control_nrf2_lfclk.c deleted file mode 100644 index 63f326c9e74..00000000000 --- a/drivers/clock_control/clock_control_nrf2_lfclk.c +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#define DT_DRV_COMPAT nordic_nrf_lfclk - -#include "clock_control_nrf2_common.h" -#include -#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"); - -#define LFCLK_LFXO_NODE DT_INST_PHANDLE_BY_NAME(0, clocks, lfxo) -#define LFCLK_HFXO_NODE DT_INST_PHANDLE_BY_NAME(0, clocks, hfxo) - -#define LFCLK_HAS_LFXO DT_NODE_HAS_STATUS(LFCLK_LFXO_NODE, okay) - -#define LFCLK_LFLPRC_ACCURACY DT_INST_PROP(0, lflprc_accuracy_ppm) -#define LFCLK_LFRC_ACCURACY DT_INST_PROP(0, lfrc_accuracy_ppm) -#define LFCLK_LFXO_ACCURACY DT_PROP(LFCLK_LFXO_NODE, accuracy_ppm) -#define LFCLK_HFXO_ACCURACY DT_PROP(LFCLK_HFXO_NODE, accuracy_ppm) - -#if LFCLK_HAS_LFXO -#define LFCLK_MAX_ACCURACY LFCLK_LFXO_ACCURACY -#else -#define LFCLK_MAX_ACCURACY LFCLK_HFXO_ACCURACY -#endif - -#define NRFS_CLOCK_TIMEOUT K_MSEC(CONFIG_CLOCK_CONTROL_NRF2_NRFS_CLOCK_TIMEOUT_MS) - -/* Clock options sorted from lowest to highest accuracy/precision */ -static const struct clock_options { - uint16_t accuracy : 15; - uint16_t precision : 1; - nrfs_clock_src_t src; -} clock_options[] = { - { - .accuracy = LFCLK_LFLPRC_ACCURACY, - .precision = 0, - .src = NRFS_CLOCK_SRC_LFCLK_LFLPRC, - }, - { - .accuracy = LFCLK_LFRC_ACCURACY, - .precision = 0, - .src = NRFS_CLOCK_SRC_LFCLK_LFRC, - }, - { - /* NRFS will request FLL16M use HFXO in bypass mode if SYNTH src is used */ - .accuracy = LFCLK_HFXO_ACCURACY, - .precision = 1, - .src = NRFS_CLOCK_SRC_LFCLK_SYNTH, - }, -#if LFCLK_HAS_LFXO -#if DT_ENUM_HAS_VALUE(LFCLK_LFXO_NODE, mode, crystal) - { - .accuracy = LFCLK_LFXO_ACCURACY, - .src = NRFS_CLOCK_SRC_LFCLK_XO_PIERCE, - }, - { - .accuracy = LFCLK_LFXO_ACCURACY, - .precision = 1, - .src = NRFS_CLOCK_SRC_LFCLK_XO_PIERCE_HP, - }, -#elif DT_ENUM_HAS_VALUE(LFCLK_LFXO_NODE, mode, external_sine) - { - .accuracy = LFCLK_LFXO_ACCURACY, - .precision = 0, - .src = NRFS_CLOCK_SRC_LFCLK_XO_EXT_SINE, - }, - { - .accuracy = LFCLK_LFXO_ACCURACY, - .precision = 1, - .src = NRFS_CLOCK_SRC_LFCLK_XO_EXT_SINE_HP, - }, -#elif DT_ENUM_HAS_VALUE(LFCLK_LFXO_NODE, mode, external_square) - { - .accuracy = LFCLK_LFXO_ACCURACY, - .precision = 0, - .src = NRFS_CLOCK_SRC_LFCLK_XO_EXT_SQUARE, - }, -#else -#error "unsupported LFXO mode" -#endif -#endif -}; - -struct lfclk_dev_data { - NRF2_STRUCT_CLOCK_CONFIG(lfclk, ARRAY_SIZE(clock_options)) clk_cfg; - struct k_timer timer; -}; - -struct lfclk_dev_config { - uint32_t fixed_frequency; -}; - -static void clock_evt_handler(nrfs_clock_evt_t const *p_evt, void *context) -{ - struct lfclk_dev_data *dev_data = context; - int status = 0; - - k_timer_stop(&dev_data->timer); - - if (p_evt->type == NRFS_CLOCK_EVT_REJECT) { - status = -ENXIO; - } - - nrf2_clock_config_update_end(&dev_data->clk_cfg, status); -} - -static void lfclk_update_timeout_handler(struct k_timer *timer) -{ - struct lfclk_dev_data *dev_data = - CONTAINER_OF(timer, struct lfclk_dev_data, timer); - - nrf2_clock_config_update_end(&dev_data->clk_cfg, -ETIMEDOUT); -} - -static void lfclk_work_handler(struct k_work *work) -{ - struct lfclk_dev_data *dev_data = - CONTAINER_OF(work, struct lfclk_dev_data, clk_cfg.work); - uint8_t to_activate_idx; - nrfs_err_t err; - - to_activate_idx = nrf2_clock_config_update_begin(work); - - err = nrfs_clock_lfclk_src_set(clock_options[to_activate_idx].src, - dev_data); - if (err != NRFS_SUCCESS) { - nrf2_clock_config_update_end(&dev_data->clk_cfg, -EIO); - } else { - k_timer_start(&dev_data->timer, NRFS_CLOCK_TIMEOUT, K_NO_WAIT); - } -} - -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 accuracy; - - if (!spec) { - return &dev_data->clk_cfg.onoff[0].mgr; - } - - if (spec->frequency > dev_config->fixed_frequency) { - LOG_ERR("invalid frequency"); - return NULL; - } - - accuracy = spec->accuracy == NRF_CLOCK_CONTROL_ACCURACY_MAX - ? LFCLK_MAX_ACCURACY - : spec->accuracy; - - for (int i = 0; i < ARRAY_SIZE(clock_options); ++i) { - if ((accuracy && - accuracy < clock_options[i].accuracy) || - spec->precision > clock_options[i].precision) { - continue; - } - - return &dev_data->clk_cfg.onoff[i].mgr; - } - - LOG_ERR("invalid accuracy or precision"); - 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(dev, spec); - - if (mgr) { - return onoff_request(mgr, cli); - } - - return -EINVAL; -} - -static int api_release_lfclk(const struct device *dev, - const struct nrf_clock_spec *spec) -{ - struct onoff_manager *mgr = lfclk_find_mgr(dev, spec); - - if (mgr) { - return onoff_release(mgr); - } - - return -EINVAL; -} - -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(dev, spec); - - if (mgr) { - return onoff_cancel_or_release(mgr, cli); - } - - return -EINVAL; -} - -static int api_get_rate_lfclk(const struct device *dev, - clock_control_subsys_t sys, - uint32_t *rate) -{ - ARG_UNUSED(sys); - - const struct lfclk_dev_config *dev_config = dev->config; - - *rate = dev_config->fixed_frequency; - - return 0; -} - -static int lfclk_init(const struct device *dev) -{ - struct lfclk_dev_data *dev_data = dev->data; - nrfs_err_t res; - - res = nrfs_clock_init(clock_evt_handler); - if (res != NRFS_SUCCESS) { - return -EIO; - } - - k_timer_init(&dev_data->timer, lfclk_update_timeout_handler, NULL); - - return nrf2_clock_config_init(&dev_data->clk_cfg, - ARRAY_SIZE(dev_data->clk_cfg.onoff), - lfclk_work_handler); -} - -static struct nrf_clock_control_driver_api lfclk_drv_api = { - .std_api = { - .on = api_nosys_on_off, - .off = api_nosys_on_off, - .get_rate = api_get_rate_lfclk, - }, - .request = api_request_lfclk, - .release = api_release_lfclk, - .cancel_or_release = api_cancel_or_release_lfclk, -}; - -static struct lfclk_dev_data lfclk_data; - -static const struct lfclk_dev_config lfclk_config = { - .fixed_frequency = DT_INST_PROP(0, clock_frequency), -}; - -DEVICE_DT_INST_DEFINE(0, lfclk_init, NULL, - &lfclk_data, &lfclk_config, - PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, - &lfclk_drv_api); diff --git a/include/zephyr/drivers/clock_control/nrf_clock_control.h b/include/zephyr/drivers/clock_control/nrf_clock_control.h index b7764b91a86..5ec409770e0 100644 --- a/include/zephyr/drivers/clock_control/nrf_clock_control.h +++ b/include/zephyr/drivers/clock_control/nrf_clock_control.h @@ -8,9 +8,7 @@ #define ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_NRF_CLOCK_CONTROL_H_ #include -#ifdef NRF_CLOCK #include -#endif #include #include @@ -18,8 +16,6 @@ extern "C" { #endif -#if defined(CONFIG_CLOCK_CONTROL_NRF) - /** @brief Clocks handled by the CLOCK peripheral. * * Enum shall be used as a sys argument in clock_control API. @@ -155,145 +151,6 @@ void z_nrf_clock_bt_ctlr_hf_request(void); */ void z_nrf_clock_bt_ctlr_hf_release(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 - -/* Specifies to use the maximum available accuracy for a given clock. */ -#define NRF_CLOCK_CONTROL_ACCURACY_MAX 1 -/* Specifies the required clock accuracy in parts-per-million. */ -#define NRF_CLOCK_CONTROL_ACCURACY_PPM(ppm) (ppm) - -/* Specifies that high precision of the clock is required. */ -#define NRF_CLOCK_CONTROL_PRECISION_HIGH 1 -/* Specifies that default precision of the clock is sufficient. */ -#define NRF_CLOCK_CONTROL_PRECISION_DEFAULT 0 - -struct nrf_clock_spec { - uint32_t frequency; - uint16_t accuracy : 15; - uint16_t precision : 1; -}; - -__subsystem struct nrf_clock_control_driver_api { - struct clock_control_driver_api std_api; - - int (*request)(const struct device *dev, - const struct nrf_clock_spec *spec, - struct onoff_client *cli); - int (*release)(const struct device *dev, - const struct nrf_clock_spec *spec); - int (*cancel_or_release)(const struct device *dev, - const struct nrf_clock_spec *spec, - struct onoff_client *cli); -}; - -/** - * @brief Request a reservation to use a given clock with specified attributes. - * - * The return value indicates the success or failure of an attempt to initiate - * an operation to request the clock be made available. If initiation of the - * operation succeeds, the result of the request operation is provided through - * the configured client notification method, possibly before this call returns. - * - * Note that the call to this function may succeed in a case where the actual - * request fails. Always check the operation completion result. - * - * @param dev pointer to the clock device structure. - * @param spec specification of minimal acceptable attributes, like frequency, - * accuracy, and precision, required for the clock. - * Value of 0 has the meaning of "default" and can be passed - * instead of a given attribute if there is no strict requirement - * in this regard. If there is no specific requirement for any of - * the attributes, this parameter can be NULL. - * @param cli pointer to client state providing instructions on synchronous - * expectations and how to notify the client when the request - * completes. Behavior is undefined if client passes a pointer - * object associated with an incomplete service operation. - * - * @retval non-negative the observed state of the on-off service associated - * with the clock machine at the time the request was - * processed (see onoff_request()), if successful. - * @retval -EIO if service has recorded an error. - * @retval -EINVAL if the function parameters are invalid or the clock - * attributes cannot be provided (e.g. the requested accuracy - * is unavailable). - * @retval -EAGAIN if the reference count would overflow. - */ -static inline -int nrf_clock_control_request(const struct device *dev, - const struct nrf_clock_spec *spec, - struct onoff_client *cli) -{ - const struct nrf_clock_control_driver_api *api = - (const struct nrf_clock_control_driver_api *)dev->api; - - return api->request(dev, spec, cli); -} - -/** - * @brief Release a reserved use of a clock. - * - * @param dev pointer to the clock device structure. - * @param spec the same specification of the clock attributes that was used - * in the reservation request (so that the clock control module - * can keep track of what attributes are still requested). - * - * @retval non-negative the observed state of the on-off service associated - * with the clock machine at the time the request was - * processed (see onoff_release()), if successful. - * @retval -EIO if service has recorded an error. - * @retval -ENOTSUP if the service is not in a state that permits release. - */ -static inline -int nrf_clock_control_release(const struct device *dev, - const struct nrf_clock_spec *spec) -{ - const struct nrf_clock_control_driver_api *api = - (const struct nrf_clock_control_driver_api *)dev->api; - - return api->release(dev, spec); -} - -/** - * @brief Safely cancel a reservation request. - * - * It may be that a client has issued a reservation request but needs to - * shut down before the request has completed. This function attempts to - * cancel the request and issues a release if cancellation fails because - * the request was completed. This synchronously ensures that ownership - * data reverts to the client so is available for a future request. - * - * @param dev pointer to the clock device structure. - * @param spec the same specification of the clock attributes that was used - * in the reservation request. - * @param cli a pointer to the same client state that was provided - * when the operation to be cancelled was issued. - * - * @retval ONOFF_STATE_TO_ON if the cancellation occurred before the transition - * completed. - * @retval ONOFF_STATE_ON if the cancellation occurred after the transition - * completed. - * @retval -EINVAL if the parameters are invalid. - * @retval negative other errors produced by onoff_release(). - */ -static inline -int nrf_clock_control_cancel_or_release(const struct device *dev, - const struct nrf_clock_spec *spec, - struct onoff_client *cli) -{ - const struct nrf_clock_control_driver_api *api = - (const struct nrf_clock_control_driver_api *)dev->api; - - return api->cancel_or_release(dev, spec, cli); -} - -#endif /* defined(CONFIG_CLOCK_CONTROL_NRF2) */ - #ifdef __cplusplus } #endif diff --git a/soc/nordic/Kconfig.defconfig b/soc/nordic/Kconfig.defconfig index 513d1240d53..5e7e9c5a09d 100644 --- a/soc/nordic/Kconfig.defconfig +++ b/soc/nordic/Kconfig.defconfig @@ -11,7 +11,7 @@ rsource "*/Kconfig.defconfig" if SYS_CLOCK_EXISTS config CLOCK_CONTROL - default y + default y if !SOC_SERIES_NRF54HX endif # SYS_CLOCK_EXISTS From d5bb270b36b906ac5a1af89bab08bd5e48a79f61 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 150/825] Revert "[nrf fromlist] dts: bindings: add nrf-fll16m and nrf-lfclk bindings" This reverts commit 371b3d05c411e82d608ceaaf633f3e827d9e5262. --- dts/bindings/clock/nordic,nrf-fll16m.yaml | 42 ----------------------- dts/bindings/clock/nordic,nrf-lfclk.yaml | 42 ----------------------- dts/common/nordic/nrf54h20.dtsi | 13 ++----- 3 files changed, 2 insertions(+), 95 deletions(-) delete mode 100644 dts/bindings/clock/nordic,nrf-fll16m.yaml delete mode 100644 dts/bindings/clock/nordic,nrf-lfclk.yaml diff --git a/dts/bindings/clock/nordic,nrf-fll16m.yaml b/dts/bindings/clock/nordic,nrf-fll16m.yaml deleted file mode 100644 index 150910afbc9..00000000000 --- a/dts/bindings/clock/nordic,nrf-fll16m.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -description: | - nRF FLL16M - - The FLL16M can use the following clocks as clock sources: - - - HFXO: The HFXO clock is used as a clock source if the - FLL16M mode is BYPASS, or if the FLL16M mode is - closed-loop and the LFXO clock is not available. - - - LFXO: The LFXO clock is used as a clock source if the - FLL16M mode is closed-loop and the LFXO clock is - available. - - Devicetree example: - - fll16m { - open-loop-accuracy-ppm = <20000>; - closed-loop-base-accuracy-ppm = <5000>; - clocks = <&hfxo>, <&lfxo>; - clock-names = "hfxo", "lfxo"; - }; - -compatible: "nordic,nrf-fll16m" - -include: fixed-clock.yaml - -properties: - clock-frequency: - const: 16000000 - - open-loop-accuracy-ppm: - type: int - description: Clock accuracy in parts per million if open-loop clock source is used. - - closed-loop-base-accuracy-ppm: - type: int - description: | - Base clock accuracy in parts per million if closed-loop clock source is used. - The actual accuracy is this property plus the accuracy of the HFXO or LFXO. diff --git a/dts/bindings/clock/nordic,nrf-lfclk.yaml b/dts/bindings/clock/nordic,nrf-lfclk.yaml deleted file mode 100644 index 7c470561d3b..00000000000 --- a/dts/bindings/clock/nordic,nrf-lfclk.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -description: | - nRF LFCLK (Low Frequency CLocK) - - The LFCLK can use the following clocks as clock sources: - - - HFXO: The HFXO clock is used as a clock source if the - LFCLK SYNTH mode is selected and the LFXO clock is not - available. The HFXO clock is used indirectly through - the FLL16M clock in BYPASS mode. - - - LFXO: The LFXO clock is used as a clock source if the - LFCLK SYNTH mode is selected and the LFXO clock is - available. The LFXO clock is used indirectly through - the FLL16M clock in BYPASS mode. - - Devicetree example: - - lfclk { - lfrc-accuracy-ppm = <500>; - lflprc-accuracy-ppm = <1000>; - clocks = <&hfxo>, <&lfxo>; - clock-names = "hfxo", "lfxo"; - }; - -compatible: "nordic,nrf-lfclk" - -include: fixed-clock.yaml - -properties: - clock-frequency: - const: 32768 - - lfrc-accuracy-ppm: - type: int - description: Clock accuracy in parts per million if LFRC clock source is used. - - lflprc-accuracy-ppm: - type: int - description: Clock accuracy in parts per million if LFLPRC clock source is used. diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index 574fd375c3f..11e5dfdb839 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -106,13 +106,9 @@ }; fll16m: fll16m { - compatible = "nordic,nrf-fll16m"; + compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = ; - open-loop-accuracy-ppm = <20000>; - closed-loop-base-accuracy-ppm = <5000>; - clocks = <&hfxo>, <&lfxo>; - clock-names = "hfxo", "lfxo"; }; hsfll120: hsfll120 { @@ -123,14 +119,9 @@ }; lfclk: lfclk { - compatible = "nordic,nrf-lfclk"; + compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <32768>; - status = "okay"; - lfrc-accuracy-ppm = <500>; - lflprc-accuracy-ppm = <1000>; - clocks = <&hfxo>, <&lfxo>; - clock-names = "hfxo", "lfxo"; }; }; From 9617126ff4d3eba79cf4416e2a0f2d4c921b0c2d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 151/825] Revert "[nrf fromlist] boards: nrf54h20dk: Add parameters of mounted HFXO and LFXO" This reverts commit fdb754510361c9017451ab5e080bbe6fa3d56ef6. --- .../nrf54h20dk_nrf54h20-common.dtsi | 23 ------------------- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 4 +++- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts | 4 +++- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts | 4 +++- 4 files changed, 9 insertions(+), 26 deletions(-) delete mode 100644 boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-common.dtsi diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-common.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-common.dtsi deleted file mode 100644 index 595307aec8c..00000000000 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-common.dtsi +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "nrf54h20dk_nrf54h20-memory_map.dtsi" -#include "nrf54h20dk_nrf54h20-ipc_conf.dtsi" -#include "nrf54h20dk_nrf54h20-pinctrl.dtsi" - -&hfxo { - status = "okay"; - accuracy-ppm = <30>; - startup-time-us = <850>; - mode = "crystal"; -}; - -&lfxo { - status = "okay"; - accuracy-ppm = <20>; - startup-time-us = <600000>; - mode = "crystal"; -}; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index fe48d88703b..3f30503800b 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -7,7 +7,9 @@ /dts-v1/; #include -#include "nrf54h20dk_nrf54h20-common.dtsi" +#include "nrf54h20dk_nrf54h20-memory_map.dtsi" +#include "nrf54h20dk_nrf54h20-ipc_conf.dtsi" +#include "nrf54h20dk_nrf54h20-pinctrl.dtsi" #include "nrf54h20dk_bicr.dtsi" /delete-node/ &cpurad_cpusys_ipc; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts index 0249d4bd87d..80b690839d7 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts @@ -7,7 +7,9 @@ /dts-v1/; #include -#include "nrf54h20dk_nrf54h20-common.dtsi" +#include "nrf54h20dk_nrf54h20-memory_map.dtsi" +#include "nrf54h20dk_nrf54h20-ipc_conf.dtsi" +#include "nrf54h20dk_nrf54h20-pinctrl.dtsi" /delete-node/ &cpuapp_cpurad_ipc; /delete-node/ &cpuapp_cpusys_ipc; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts index d0214652c2e..fb05ad589f6 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpurad.dts @@ -7,7 +7,9 @@ /dts-v1/; #include -#include "nrf54h20dk_nrf54h20-common.dtsi" +#include "nrf54h20dk_nrf54h20-memory_map.dtsi" +#include "nrf54h20dk_nrf54h20-ipc_conf.dtsi" +#include "nrf54h20dk_nrf54h20-pinctrl.dtsi" /delete-node/ &cpuapp_cpuppr_ipc; /delete-node/ &cpuapp_cpusys_ipc; From af2c74d5b2072ddd33f83048703f6e6896745a20 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 152/825] Revert "[nrf fromlist] dts: nordic: nrf54h20: Add nodes representing HFXO and LFXO" This reverts commit 630e9e763209bd93c75fa162ff1b84c2cf5f4231. --- dts/bindings/clock/nordic,nrf54h-hfxo.yaml | 30 --------------------- dts/bindings/clock/nordic,nrf54h-lfxo.yaml | 31 ---------------------- dts/common/nordic/nrf54h20.dtsi | 10 +------ 3 files changed, 1 insertion(+), 70 deletions(-) delete mode 100644 dts/bindings/clock/nordic,nrf54h-hfxo.yaml delete mode 100644 dts/bindings/clock/nordic,nrf54h-lfxo.yaml diff --git a/dts/bindings/clock/nordic,nrf54h-hfxo.yaml b/dts/bindings/clock/nordic,nrf54h-hfxo.yaml deleted file mode 100644 index 1dab8b99cf8..00000000000 --- a/dts/bindings/clock/nordic,nrf54h-hfxo.yaml +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic nRF54H Series high-frequency crystal oscillator - -compatible: "nordic,nrf54h-hfxo" - -include: fixed-clock.yaml - -properties: - clock-frequency: - const: 32000000 - - accuracy-ppm: - type: int - description: Clock accuracy in parts per million - required: true - - startup-time-us: - type: int - description: Clock startup time in micro seconds - required: true - - mode: - type: string - description: HFXO operational mode - required: true - enum: - - "crystal" - - "external-square" diff --git a/dts/bindings/clock/nordic,nrf54h-lfxo.yaml b/dts/bindings/clock/nordic,nrf54h-lfxo.yaml deleted file mode 100644 index 3a85f27972d..00000000000 --- a/dts/bindings/clock/nordic,nrf54h-lfxo.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic nRF54H Series low-frequency crystal oscillator - -compatible: "nordic,nrf54h-lfxo" - -include: fixed-clock.yaml - -properties: - clock-frequency: - const: 32768 - - accuracy-ppm: - type: int - description: Clock accuracy in parts per million - required: true - - startup-time-us: - type: int - description: Clock startup time in micro seconds - required: true - - mode: - type: string - description: LFXO operational mode - required: true - enum: - - "crystal" - - "external-sine" - - "external-square" diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index 11e5dfdb839..49e20d47888 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -92,19 +92,11 @@ clocks { hfxo: hfxo { - compatible = "nordic,nrf54h-hfxo"; - status = "disabled"; + compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = ; }; - lfxo: lfxo { - compatible = "nordic,nrf54h-lfxo"; - status = "disabled"; - #clock-cells = <0>; - clock-frequency = <32768>; - }; - fll16m: fll16m { compatible = "fixed-clock"; #clock-cells = <0>; From 4820a7fb81cbc7574c379734a1faddc1b2ff191a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 153/825] Revert "[nrf fromlist] dts: nordic: nrf54h20: Add references to clock controllers" This reverts commit 4b009a787bd6581f67b460b8ccc279765f9ceb84. --- dts/common/nordic/nrf54h20.dtsi | 70 --------------------------------- 1 file changed, 70 deletions(-) diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index 49e20d47888..816a64da105 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -25,7 +25,6 @@ compatible = "arm,cortex-m33"; reg = <2>; device_type = "cpu"; - clocks = <&cpuapp_hsfll>; clock-frequency = ; }; @@ -33,7 +32,6 @@ compatible = "arm,cortex-m33"; reg = <3>; device_type = "cpu"; - clocks = <&cpurad_hsfll>; clock-frequency = ; }; @@ -41,7 +39,6 @@ compatible = "nordic,vpr"; reg = <13>; device_type = "cpu"; - clocks = <&fll16m>; clock-frequency = ; riscv,isa = "rv32emc"; nordic,bus-width = <32>; @@ -102,19 +99,6 @@ #clock-cells = <0>; clock-frequency = ; }; - - hsfll120: hsfll120 { - compatible = "fixed-clock"; - clocks = <&fll16m>; - #clock-cells = <0>; - clock-frequency = ; - }; - - lfclk: lfclk { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <32768>; - }; }; soc { @@ -196,7 +180,6 @@ reg = <0x14000 0x1000>; status = "disabled"; interrupts = <20 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&lfclk>; }; cpuapp_wdt011: watchdog@15000 { @@ -204,7 +187,6 @@ reg = <0x15000 0x1000>; status = "disabled"; interrupts = <21 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&lfclk>; }; cpuapp_ieee802154: ieee802154 { @@ -241,7 +223,6 @@ reg = <0x13000 0x1000>; status = "disabled"; interrupts = <19 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&lfclk>; }; cpurad_wdt011: watchdog@14000 { @@ -249,7 +230,6 @@ reg = <0x14000 0x1000>; status = "disabled"; interrupts = <20 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&lfclk>; }; cpurad_resetinfo: resetinfo@1e000 { @@ -285,7 +265,6 @@ status = "disabled"; cc-num = <8>; interrupts = <40 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-bit-width = <32>; max-frequency = ; prescaler = <0>; @@ -297,7 +276,6 @@ status = "disabled"; cc-num = <8>; interrupts = <41 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-bit-width = <32>; max-frequency = ; prescaler = <0>; @@ -309,7 +287,6 @@ status = "disabled"; cc-num = <8>; interrupts = <42 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-bit-width = <32>; max-frequency = ; prescaler = <0>; @@ -322,7 +299,6 @@ cc-num = <4>; clock-frequency = <32768>; interrupts = <43 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&lfclk>; prescaler = <1>; }; @@ -335,7 +311,6 @@ dfe-supported; ieee802154-supported; interrupts = <44 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&hfxo>; cpurad_ieee802154: ieee802154 { compatible = "nordic,nrf-ieee802154"; @@ -603,7 +578,6 @@ cc-num = <4>; clock-frequency = <32768>; interrupts = <296 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&lfclk>; prescaler = <1>; }; @@ -614,7 +588,6 @@ cc-num = <4>; clock-frequency = <32768>; interrupts = <297 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&lfclk>; prescaler = <1>; }; @@ -623,7 +596,6 @@ reg = <0x92b000 0x1000>; status = "disabled"; interrupts = <299 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&lfclk>; }; wdt132: watchdog@92c000 { @@ -631,7 +603,6 @@ reg = <0x92c000 0x1000>; status = "disabled"; interrupts = <300 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&lfclk>; }; gpiote130: gpiote@934000 { @@ -766,11 +737,6 @@ reg = <0x99c000 0x1000>; status = "disabled"; cc-num = <16>; - /* GRTC uses both LFCLK and FLL16M, but its accuracy and - * precision are inherited from LFCLK. that's why this - * one is linked here. - */ - clocks = <&lfclk>; }; dppic133: dppic@9a1000 { @@ -785,7 +751,6 @@ status = "disabled"; cc-num = <6>; interrupts = <418 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-bit-width = <32>; prescaler = <0>; }; @@ -796,7 +761,6 @@ status = "disabled"; cc-num = <6>; interrupts = <419 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-bit-width = <32>; prescaler = <0>; }; @@ -806,7 +770,6 @@ reg = <0x9a4000 0x1000>; status = "disabled"; interrupts = <420 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; #pwm-cells = <3>; }; @@ -815,7 +778,6 @@ reg = <0x9a5000 0x1000>; status = "disabled"; interrupts = <421 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -827,7 +789,6 @@ status = "disabled"; easydma-maxcnt-bits = <15>; interrupts = <421 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -840,7 +801,6 @@ reg = <0x9a5000 0x1000>; status = "disabled"; interrupts = <421 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; }; i2c131: i2c@9a6000 { @@ -848,7 +808,6 @@ reg = <0x9a6000 0x1000>; status = "disabled"; interrupts = <422 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -860,7 +819,6 @@ status = "disabled"; easydma-maxcnt-bits = <15>; interrupts = <422 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -873,7 +831,6 @@ reg = <0x9a6000 0x1000>; status = "disabled"; interrupts = <422 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; }; dppic134: dppic@9b1000 { @@ -888,7 +845,6 @@ status = "disabled"; cc-num = <6>; interrupts = <434 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-bit-width = <32>; prescaler = <0>; }; @@ -899,7 +855,6 @@ status = "disabled"; cc-num = <6>; interrupts = <435 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-bit-width = <32>; prescaler = <0>; }; @@ -909,7 +864,6 @@ reg = <0x9b4000 0x1000>; status = "disabled"; interrupts = <436 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; #pwm-cells = <3>; }; @@ -918,7 +872,6 @@ reg = <0x9b5000 0x1000>; status = "disabled"; interrupts = <437 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -930,7 +883,6 @@ status = "disabled"; easydma-maxcnt-bits = <15>; interrupts = <437 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -943,7 +895,6 @@ reg = <0x9b5000 0x1000>; status = "disabled"; interrupts = <437 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; }; i2c133: i2c@9b6000 { @@ -951,7 +902,6 @@ reg = <0x9b6000 0x1000>; status = "disabled"; interrupts = <438 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -963,7 +913,6 @@ status = "disabled"; easydma-maxcnt-bits = <15>; interrupts = <438 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -976,7 +925,6 @@ reg = <0x9b6000 0x1000>; status = "disabled"; interrupts = <438 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; }; dppic135: dppic@9c1000 { @@ -991,7 +939,6 @@ status = "disabled"; cc-num = <6>; interrupts = <450 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-bit-width = <32>; prescaler = <0>; }; @@ -1002,7 +949,6 @@ status = "disabled"; cc-num = <6>; interrupts = <451 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-bit-width = <32>; prescaler = <0>; }; @@ -1012,7 +958,6 @@ reg = <0x9c4000 0x1000>; status = "disabled"; interrupts = <452 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; #pwm-cells = <3>; }; @@ -1021,7 +966,6 @@ reg = <0x9c5000 0x1000>; status = "disabled"; interrupts = <453 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1033,7 +977,6 @@ status = "disabled"; easydma-maxcnt-bits = <15>; interrupts = <453 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1046,7 +989,6 @@ reg = <0x9c5000 0x1000>; status = "disabled"; interrupts = <453 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; }; i2c135: i2c@9c6000 { @@ -1054,7 +996,6 @@ reg = <0x9c6000 0x1000>; status = "disabled"; interrupts = <454 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1066,7 +1007,6 @@ status = "disabled"; easydma-maxcnt-bits = <15>; interrupts = <454 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1079,7 +1019,6 @@ reg = <0x9c6000 0x1000>; status = "disabled"; interrupts = <454 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; }; dppic136: dppic@9d1000 { @@ -1094,7 +1033,6 @@ status = "disabled"; cc-num = <6>; interrupts = <466 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-bit-width = <32>; prescaler = <0>; }; @@ -1105,7 +1043,6 @@ status = "disabled"; cc-num = <6>; interrupts = <467 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-bit-width = <32>; prescaler = <0>; }; @@ -1115,7 +1052,6 @@ reg = <0x9d4000 0x1000>; status = "disabled"; interrupts = <468 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; #pwm-cells = <3>; }; @@ -1124,7 +1060,6 @@ reg = <0x9d5000 0x1000>; status = "disabled"; interrupts = <469 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1136,7 +1071,6 @@ status = "disabled"; easydma-maxcnt-bits = <15>; interrupts = <469 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1149,7 +1083,6 @@ reg = <0x9d5000 0x1000>; status = "disabled"; interrupts = <469 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; }; i2c137: i2c@9d6000 { @@ -1157,7 +1090,6 @@ reg = <0x9d6000 0x1000>; status = "disabled"; interrupts = <470 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; easydma-maxcnt-bits = <15>; #address-cells = <1>; #size-cells = <0>; @@ -1169,7 +1101,6 @@ status = "disabled"; easydma-maxcnt-bits = <15>; interrupts = <470 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; max-frequency = ; #address-cells = <1>; #size-cells = <0>; @@ -1182,7 +1113,6 @@ reg = <0x9d6000 0x1000>; status = "disabled"; interrupts = <470 NRF_DEFAULT_IRQ_PRIORITY>; - clocks = <&fll16m>; }; }; }; From 810607361e9edb1f90e36745151344d6acb9e036 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 154/825] Revert "[nrf fromtree] dts: bindings: clock: fixed-clock: include base.yaml" This reverts commit fe1f649eef05a08bf896cf66faa65567faacf434. --- dts/bindings/clock/fixed-clock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dts/bindings/clock/fixed-clock.yaml b/dts/bindings/clock/fixed-clock.yaml index 3e451089e70..d3bd9deea5a 100644 --- a/dts/bindings/clock/fixed-clock.yaml +++ b/dts/bindings/clock/fixed-clock.yaml @@ -5,7 +5,7 @@ description: Generic fixed-rate clock provider compatible: "fixed-clock" -include: [base.yaml, clock-controller.yaml] +include: clock-controller.yaml properties: clock-frequency: From 89b9f9a059b9bd230ba9c21fb9f112feb1e2e4d0 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 155/825] Revert "[nrf fromtree] modules: hal_nordic: dvfs: added callback when scaling done" This reverts commit 9e800538bf56c088655231ad4de4840b3923f47d. --- modules/hal_nordic/nrfs/dvfs/Kconfig | 5 -- .../hal_nordic/nrfs/dvfs/ld_dvfs_handler.c | 84 +++---------------- .../hal_nordic/nrfs/dvfs/ld_dvfs_handler.h | 16 +--- 3 files changed, 13 insertions(+), 92 deletions(-) diff --git a/modules/hal_nordic/nrfs/dvfs/Kconfig b/modules/hal_nordic/nrfs/dvfs/Kconfig index bd6f2e4e99a..0a6078a0db0 100644 --- a/modules/hal_nordic/nrfs/dvfs/Kconfig +++ b/modules/hal_nordic/nrfs/dvfs/Kconfig @@ -26,11 +26,6 @@ config NRFS_LOCAL_DOMAIN_DOWNSCALE_SAFETY_TIMEOUT_US default 1000000 if (NRFS_LOCAL_DOMAIN_DVFS_TEST || LOG) default 1500 -config NRFS_LOCAL_DOMAIN_DOWNSCALE_FINISH_DELAY_TIMEOUT_US - int "Additional delay to let secdom finish dowscale procedure in us" - range 1 10000000 - default 1000 - config NRFS_LOCAL_DOMAIN_DVFS_HANDLER_TASK_STACK_SIZE int "Stack size used for DVFS handling task" range 256 2048 diff --git a/modules/hal_nordic/nrfs/dvfs/ld_dvfs_handler.c b/modules/hal_nordic/nrfs/dvfs/ld_dvfs_handler.c index c28d9187a55..6a3a2756856 100644 --- a/modules/hal_nordic/nrfs/dvfs/ld_dvfs_handler.c +++ b/modules/hal_nordic/nrfs/dvfs/ld_dvfs_handler.c @@ -19,12 +19,10 @@ static K_SEM_DEFINE(dvfs_service_sync_sem, 0, 1); static K_SEM_DEFINE(dvfs_service_idle_sem, 0, 1); #define DVFS_SERV_HDL_INIT_DONE_BIT_POS (0) -#define DVFS_SERV_HDL_FREQ_CHANGE_REQ_PENDING_BIT_POS (1) +#define DVFS_SERV_HDL_FREQ_CHANGE_IN_PROGRESS_BIT_POS (1) static atomic_t dvfs_service_handler_state_bits; -static volatile enum dvfs_frequency_setting current_freq_setting; -static volatile enum dvfs_frequency_setting requested_freq_setting; -static dvfs_service_handler_callback dvfs_frequency_change_applied_clb; +static enum dvfs_frequency_setting current_freq_setting; static void dvfs_service_handler_set_state_bit(uint32_t bit_pos) { @@ -46,9 +44,9 @@ static bool dvfs_service_handler_init_done(void) return dvfs_service_handler_get_state_bit(DVFS_SERV_HDL_INIT_DONE_BIT_POS); } -static bool dvfs_service_handler_freq_change_req_pending(void) +static bool dvfs_service_handler_freq_change_in_progress(void) { - return dvfs_service_handler_get_state_bit(DVFS_SERV_HDL_FREQ_CHANGE_REQ_PENDING_BIT_POS); + return dvfs_service_handler_get_state_bit(DVFS_SERV_HDL_FREQ_CHANGE_IN_PROGRESS_BIT_POS); } static void dvfs_service_handler_nrfs_error_check(nrfs_err_t err) @@ -89,12 +87,6 @@ static enum dvfs_frequency_setting dvfs_service_handler_get_current_oppoint(void return current_freq_setting; } -static enum dvfs_frequency_setting dvfs_service_handler_get_requested_oppoint(void) -{ - LOG_DBG("Requested LD freq setting: %d", requested_freq_setting); - return requested_freq_setting; -} - /* Function to check if current operation is down-scaling */ static bool dvfs_service_handler_is_downscaling(enum dvfs_frequency_setting target_freq_setting) { @@ -151,12 +143,7 @@ static void dvfs_service_handler_scaling_finish(enum dvfs_frequency_setting oppo dvfs_service_handler_error(err); } } - dvfs_service_handler_clear_state_bit(DVFS_SERV_HDL_FREQ_CHANGE_REQ_PENDING_BIT_POS); current_freq_setting = oppoint_freq; - LOG_DBG("Current LD freq setting: %d", current_freq_setting); - if (dvfs_frequency_change_applied_clb) { - dvfs_frequency_change_applied_clb(current_freq_setting); - } } /* Function to set hsfll to highest frequency when switched to ABB. */ @@ -165,29 +152,11 @@ static void dvfs_service_handler_set_initial_hsfll_config(void) int32_t err = ld_dvfs_configure_hsfll(DVFS_FREQ_HIGH); current_freq_setting = DVFS_FREQ_HIGH; - requested_freq_setting = DVFS_FREQ_HIGH; if (err != 0) { dvfs_service_handler_error(err); } } -/* Timer to add additional delay to finish downscale procedure when domain other than secure */ -#if !defined(NRF_SECURE) -#define SCALING_FINISH_DELAY_TIMEOUT_US \ - K_USEC(CONFIG_NRFS_LOCAL_DOMAIN_DOWNSCALE_FINISH_DELAY_TIMEOUT_US) - -static void dvfs_service_handler_scaling_finish_delay_timeout(struct k_timer *timer) -{ - if (timer) { - dvfs_service_handler_scaling_finish( - *(enum dvfs_frequency_setting *)timer->user_data); - } -} - -K_TIMER_DEFINE(dvfs_service_scaling_finish_delay_timer, - dvfs_service_handler_scaling_finish_delay_timeout, NULL); -#endif - /* DVFS event handler callback function.*/ static void nrfs_dvfs_evt_handler(nrfs_dvfs_evt_t const *p_evt, void *context) { @@ -213,13 +182,7 @@ static void nrfs_dvfs_evt_handler(nrfs_dvfs_evt_t const *p_evt, void *context) break; case NRFS_DVFS_EVT_OPPOINT_REQ_CONFIRMED: /* Optional confirmation from sysctrl, wait for oppoint.*/ - dvfs_service_handler_clear_state_bit(DVFS_SERV_HDL_FREQ_CHANGE_REQ_PENDING_BIT_POS); - LOG_DBG("DVFS handler EVT_OPPOINT_REQ_CONFIRMED %d", (uint32_t)p_evt->freq); - if (dvfs_service_handler_get_requested_oppoint() == p_evt->freq) { - if (dvfs_frequency_change_applied_clb) { - dvfs_frequency_change_applied_clb(p_evt->freq); - } - } + LOG_DBG("DVFS handler EVT_OPPOINT_REQ_CONFIRMED"); break; case NRFS_DVFS_EVT_OPPOINT_SCALING_PREPARE: /*Target oppoint will be received here.*/ @@ -233,13 +196,7 @@ static void nrfs_dvfs_evt_handler(nrfs_dvfs_evt_t const *p_evt, void *context) dvfs_service_handler_scaling_background_job(p_evt->freq); LOG_DBG("DVFS handler EVT_OPPOINT_SCALING_PREPARE handled"); #if !defined(NRF_SECURE) - /* Additional delay for downscale to finish on secdom side */ - static enum dvfs_frequency_setting freq; - - freq = p_evt->freq; - dvfs_service_scaling_finish_delay_timer.user_data = (void *)&freq; - k_timer_start(&dvfs_service_scaling_finish_delay_timer, - SCALING_FINISH_DELAY_TIMEOUT_US, K_NO_WAIT); + current_freq_setting = p_evt->freq; } else { LOG_ERR("DVFS handler - unexpected EVT_OPPOINT_SCALING_PREPARE"); } @@ -247,6 +204,7 @@ static void nrfs_dvfs_evt_handler(nrfs_dvfs_evt_t const *p_evt, void *context) break; case NRFS_DVFS_EVT_OPPOINT_SCALING_DONE: LOG_DBG("DVFS handler EVT_OPPOINT_SCALING_DONE"); + dvfs_service_handler_clear_state_bit(DVFS_SERV_HDL_FREQ_CHANGE_IN_PROGRESS_BIT_POS); dvfs_service_handler_scaling_finish(p_evt->freq); LOG_DBG("DVFS handler EVT_OPPOINT_SCALING_DONE handled"); break; @@ -317,36 +275,18 @@ int32_t dvfs_service_handler_change_freq_setting(enum dvfs_frequency_setting fre return -EAGAIN; } - if (!dvfs_service_handler_freq_setting_allowed(freq_setting)) { - LOG_ERR("Requested frequency setting %d not supported.", freq_setting); - return -ENXIO; - } - - if (dvfs_service_handler_freq_change_req_pending()) { - LOG_DBG("Frequency change request pending."); + if (dvfs_service_handler_freq_change_in_progress()) { + LOG_DBG("Frequency change in progress."); return -EBUSY; } - dvfs_service_handler_set_state_bit(DVFS_SERV_HDL_FREQ_CHANGE_REQ_PENDING_BIT_POS); - requested_freq_setting = freq_setting; + if (!dvfs_service_handler_freq_setting_allowed(freq_setting)) { + return -ENXIO; + } nrfs_err_t status = nrfs_dvfs_oppoint_request(freq_setting, get_next_context()); - if (status != NRFS_SUCCESS) { - dvfs_service_handler_clear_state_bit(DVFS_SERV_HDL_FREQ_CHANGE_REQ_PENDING_BIT_POS); - } - dvfs_service_handler_nrfs_error_check(status); return status; } - -void dvfs_service_handler_register_freq_setting_applied_callback(dvfs_service_handler_callback clb) -{ - if (clb) { - LOG_DBG("Registered frequency applied callback"); - dvfs_frequency_change_applied_clb = clb; - } else { - LOG_ERR("Invalid callback function provided!"); - } -} diff --git a/modules/hal_nordic/nrfs/dvfs/ld_dvfs_handler.h b/modules/hal_nordic/nrfs/dvfs/ld_dvfs_handler.h index c13deb71433..b15e630eb2c 100644 --- a/modules/hal_nordic/nrfs/dvfs/ld_dvfs_handler.h +++ b/modules/hal_nordic/nrfs/dvfs/ld_dvfs_handler.h @@ -17,7 +17,7 @@ extern "C" { * @brief Function to request LD frequency change. * * @param frequency requested frequency setting from enum dvfs_frequency_setting. - * @return EBUSY Frequency change request pending. + * @return EBUSY Frequency change in progress. * @return EAGAIN DVFS init in progress. * @return ENXIO Not supported frequency settings. * @return NRFS_SUCCESS Request sent successfully. @@ -26,20 +26,6 @@ extern "C" { */ int32_t dvfs_service_handler_change_freq_setting(enum dvfs_frequency_setting freq_setting); -/** - * @brief Type to use as callback function in dvfs service - * - * @param new_setting applied frequency setting - */ -typedef void (*dvfs_service_handler_callback)(enum dvfs_frequency_setting new_setting); - -/** - * @brief Register callback function which will be called when new dvfs frequency is applied. - * - * @param clb dvfs_service_handler_callback to register - */ -void dvfs_service_handler_register_freq_setting_applied_callback(dvfs_service_handler_callback clb); - #ifdef __cplusplus } #endif From 7281557aa505fe80ef69203d85af432f2cc98ae1 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 156/825] Revert "[nrf noup] board: nordic_ thingy53: Enable QSPI by default" This reverts commit e7415e4e3943f5ccbbffc63be9c3e31fbb690766. --- 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 31ac0093ba2..c2e13fad0ab 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -145,9 +145,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 4973173c05d7fe4323d4fd13b85be615a4a91a8f Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:57 +0200 Subject: [PATCH 157/825] Revert "[nrf fromtree] Bluetooth: Mesh: Fix uninitialized field when cancelling transfer blob" This reverts commit 5f4236e29cb8b90ed9ddd4bbc8a1d91ef6c5227e. --- subsys/bluetooth/mesh/blob_srv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/subsys/bluetooth/mesh/blob_srv.c b/subsys/bluetooth/mesh/blob_srv.c index fc20290aa1b..3773a17e9af 100644 --- a/subsys/bluetooth/mesh/blob_srv.c +++ b/subsys/bluetooth/mesh/blob_srv.c @@ -221,7 +221,6 @@ static void cancel(struct bt_mesh_blob_srv *srv) srv->state.xfer.mode = BT_MESH_BLOB_XFER_MODE_NONE; srv->state.ttl = BT_MESH_TTL_DEFAULT; srv->block.number = 0xffff; - memset(srv->block.missing, 0, sizeof(srv->block.missing)); srv->state.xfer.chunk_size = 0xffff; k_work_cancel_delayable(&srv->rx_timeout); k_work_cancel_delayable(&srv->pull.report); From c46479a15ff10548a1554c893935dd60d29bcd49 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 158/825] Revert "[nrf noup] modules: hal_nordic: need exactly nrf-regtool v5.5.1" This reverts commit 468d06db5542594fe9e6420fd2e1fe30d9209699. --- 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 6171dacbd13..10ebf8102df 100644 --- a/modules/hal_nordic/CMakeLists.txt +++ b/modules/hal_nordic/CMakeLists.txt @@ -15,7 +15,7 @@ if(CONFIG_NRF_REGTOOL_GENERATE_BICR) list(APPEND nrf_regtool_components GENERATE:BICR) endif() if(DEFINED nrf_regtool_components) - find_package(nrf-regtool 5.5.1 EXACT REQUIRED + find_package(nrf-regtool 5.3.2 REQUIRED COMPONENTS ${nrf_regtool_components} PATHS ${CMAKE_CURRENT_LIST_DIR}/nrf-regtool NO_CMAKE_PATH From b5e7db119b82d903f05a1a73fb809aa5f9d309c7 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 159/825] Revert "[nrf fromtree] net: openthread: Fix missing dependency for OT `diag`." This reverts commit 46da5675c0eb3b83a706263f8f28087304e4f117. --- modules/hal_nordic/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/hal_nordic/Kconfig b/modules/hal_nordic/Kconfig index dd4e0a0859b..13ab8d9cd2f 100644 --- a/modules/hal_nordic/Kconfig +++ b/modules/hal_nordic/Kconfig @@ -204,7 +204,6 @@ config NRF_802154_SECURITY_KEY_STORAGE_SIZE config NRF_802154_CARRIER_FUNCTIONS bool "nRF 802.15.4 carrier functions" - default y if OPENTHREAD_DIAG help This option enables functions such as modulated carrier and continuous carrier. If this option is modified on a multicore SoC, its remote counterpart must be set to the exact same value. From 15829339192af716f193f96f027c9b52213a4254 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 160/825] Revert "[nrf fromlist] bluetooth: controller: kconfig: select power control for plm" This reverts commit d194bba3ca2ab267d76576669707d2a701c57ce0. --- subsys/bluetooth/controller/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index a19bd9f870b..19ecd1bf2bc 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -566,7 +566,6 @@ config BT_CTLR_LE_PATH_LOSS_MONITORING bool "LE Path Loss Monitoring Feature" depends on BT_CTLR_LE_PATH_LOSS_MONITORING_SUPPORT default y if BT_PATH_LOSS_MONITORING - select BT_CTLR_LE_POWER_CONTROL help Enable support for LE Path Loss Monitoring feature that is defined in the Bluetooth Core specification, Version 5.4 | Vol 6, Part B, Section 4.6.32. From 7300de020397786339eb74cf3aad42cca1dd62fb Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 161/825] Revert "[nrf fromlist] tests: bluetooth: shell: Add test case to build shell with plm" This reverts commit 068d4d3b1387d29859a98af79fe547cfd01fd937. --- tests/bluetooth/shell/testcase.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/bluetooth/shell/testcase.yaml b/tests/bluetooth/shell/testcase.yaml index 80c892f7bdd..eb6c7412053 100644 --- a/tests/bluetooth/shell/testcase.yaml +++ b/tests/bluetooth/shell/testcase.yaml @@ -29,13 +29,6 @@ tests: platform_allow: - native_posix build_only: true - bluetooth.shell.path_loss_monitoring: - extra_configs: - - CONFIG_BT_PATH_LOSS_MONITORING=y - - CONFIG_BT_CTLR=n - platform_allow: - - native_posix - build_only: true bluetooth.shell.subrating: extra_configs: - CONFIG_BT_SUBRATING=y From 92a8f26b7be221e69684626cfce1a17e821db152 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 162/825] Revert "[nrf fromlist] bluetooth: host: conn: Fix renamed callback_list" This reverts commit d5c70f77aa61d0c047c556c89b085c1fe7beb816. --- subsys/bluetooth/host/conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 8f664a2ebab..07750f7708d 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2974,7 +2974,7 @@ void notify_path_loss_threshold_report(struct bt_conn *conn, { struct bt_conn_cb *callback; - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { + SYS_SLIST_FOR_EACH_CONTAINER(&callback_list, callback, _node) { if (callback->path_loss_threshold_report) { callback->path_loss_threshold_report(conn, &report); } From 69b90a3db519d9e269146611e0b38af979a2763a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 163/825] Revert "[nrf noup] modules: mbedtls: remove deprecated Kconfig" This reverts commit 8bd088c7c2936dbc94eddd5ede980d45a341e73d. --- modules/mbedtls/Kconfig.psa | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/mbedtls/Kconfig.psa b/modules/mbedtls/Kconfig.psa index 0e484fbbb69..c032239040a 100644 --- a/modules/mbedtls/Kconfig.psa +++ b/modules/mbedtls/Kconfig.psa @@ -136,6 +136,22 @@ config PSA_WANT_KEY_TYPE_CHACHA20 Key for the ChaCha20 stream cipher or the ChaCha20-Poly1305 AEAD algorithm. +config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR + bool "PSA ECC key pair support" + select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + select DEPRECATED + help + DEPRECATED: This configuration will be removed in a future release, + please use the individual options for import, export, generate, + derive and public key instead. + + Elliptic curve key pair: both the private and public key. + + config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY bool "PSA ECC public key support" help From 82e5c710a48679ea7026476eb299598008319699 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 164/825] Revert "[nrf fromlist] kconfig: openthread: Add 1.4 version" This reverts commit 42f34339b66261d8bc725f7e82b8c9a4d5d3ba79. --- modules/openthread/Kconfig.features | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/openthread/Kconfig.features b/modules/openthread/Kconfig.features index eb713232c92..32f451ca38e 100644 --- a/modules/openthread/Kconfig.features +++ b/modules/openthread/Kconfig.features @@ -17,8 +17,6 @@ config OPENTHREAD_THREAD_VERSION_1_3 bool "Version 1.3" config OPENTHREAD_THREAD_VERSION_1_3_1 bool "Version 1.3.1" -config OPENTHREAD_THREAD_VERSION_1_4 - bool "Version 1.4" endchoice # OPENTHREAD_STACK_VERSION config OPENTHREAD_THREAD_VERSION @@ -27,7 +25,6 @@ config OPENTHREAD_THREAD_VERSION default "1.2" if OPENTHREAD_THREAD_VERSION_1_2 default "1.3" if OPENTHREAD_THREAD_VERSION_1_3 default "1.3.1" if OPENTHREAD_THREAD_VERSION_1_3_1 - default "1.4" if OPENTHREAD_THREAD_VERSION_1_4 default "unknown" config OPENTHREAD_ANYCAST_LOCATOR From 0d5a83de5f4689da64f4df80720246ddeff19b36 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 165/825] Revert "[nrf fromlist] scripts: nrf_common: Use cfg for SUIT paths" This reverts commit 7981a26ab5a9f74cad1685c1bda97bd6b1856e44. --- scripts/west_commands/runners/nrf_common.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index 7b26885d1ef..9f89c9e361f 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -265,14 +265,14 @@ def program_hex(self): # This logic should be executed only once per build. # Use sysbuild board qualifiers to select the context, with which the artifacts will be programmed. if self.build_conf.get('CONFIG_BOARD_QUALIFIERS') == self.sysbuild_conf.get('SB_CONFIG_BOARD_QUALIFIERS'): - mpi_hex_dir = Path(os.path.join(self.cfg.build_dir, 'zephyr')) + hex_path = Path(self.hex_) # Handle Manifest Provisioning Information if self.build_conf.getboolean('CONFIG_SUIT_MPI_GENERATE'): app_mpi_hex_file = os.fspath( - mpi_hex_dir / self.build_conf.get('CONFIG_SUIT_MPI_APP_AREA_PATH')) + hex_path.parent / self.build_conf.get('CONFIG_SUIT_MPI_APP_AREA_PATH')) rad_mpi_hex_file = os.fspath( - mpi_hex_dir / self.build_conf.get('CONFIG_SUIT_MPI_RAD_AREA_PATH')) + hex_path.parent / self.build_conf.get('CONFIG_SUIT_MPI_RAD_AREA_PATH')) self.op_program(app_mpi_hex_file, 'ERASE_NONE', None, defer=True, core='NRFDL_DEVICE_CORE_APPLICATION') self.op_program(rad_mpi_hex_file, 'ERASE_NONE', None, defer=True, core='NRFDL_DEVICE_CORE_NETWORK') @@ -281,7 +281,7 @@ def program_hex(self): # as well as the output HEX file. if not self.build_conf.getboolean('CONFIG_SOC_NRF54H20_CPUAPP') and self.sysbuild_conf.get('SB_CONFIG_SUIT_ENVELOPE'): app_root_envelope_hex_file = os.fspath( - mpi_hex_dir / 'suit_installed_envelopes_application_merged.hex') + hex_path.parent / 'suit_installed_envelopes_application_merged.hex') self.op_program(app_root_envelope_hex_file, 'ERASE_NONE', None, defer=True, core='NRFDL_DEVICE_CORE_APPLICATION') if self.build_conf.getboolean('CONFIG_SOC_NRF54H20_CPUAPP'): From 2e38d5a6cc3163a058a1a4ea041672ad9ddaacf9 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 166/825] Revert "[nrf fromtree] net: ipv6: route: get nexthop's LL address only if relevant" This reverts commit a49f603c6b11f40c3b35dc58ecd9ddc64322e8cf. --- subsys/net/ip/route.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/subsys/net/ip/route.c b/subsys/net/ip/route.c index e3c63983788..a74c3a0ec26 100644 --- a/subsys/net/ip/route.c +++ b/subsys/net/ip/route.c @@ -1031,7 +1031,7 @@ static bool is_ll_addr_supported(struct net_if *iface) int net_route_packet(struct net_pkt *pkt, struct in6_addr *nexthop) { - struct net_linkaddr_storage *lladdr = NULL; + struct net_linkaddr_storage *lladdr; struct net_nbr *nbr; int err; @@ -1045,16 +1045,16 @@ int net_route_packet(struct net_pkt *pkt, struct in6_addr *nexthop) goto error; } - if (is_ll_addr_supported(nbr->iface) && is_ll_addr_supported(net_pkt_iface(pkt)) && - is_ll_addr_supported(net_pkt_orig_iface(pkt))) { - lladdr = net_nbr_get_lladdr(nbr->idx); - if (!lladdr) { - NET_DBG("Cannot find %s neighbor link layer address.", - net_sprint_ipv6_addr(nexthop)); - err = -ESRCH; - goto error; - } + lladdr = net_nbr_get_lladdr(nbr->idx); + if (!lladdr) { + NET_DBG("Cannot find %s neighbor link layer address.", + net_sprint_ipv6_addr(nexthop)); + err = -ESRCH; + goto error; + } + if (is_ll_addr_supported(net_pkt_iface(pkt)) && + is_ll_addr_supported(net_pkt_orig_iface(pkt))) { if (!net_pkt_lladdr_src(pkt)->addr) { NET_DBG("Link layer source address not set"); err = -EINVAL; @@ -1084,11 +1084,9 @@ int net_route_packet(struct net_pkt *pkt, struct in6_addr *nexthop) net_pkt_lladdr_src(pkt)->len = net_pkt_lladdr_if(pkt)->len; } - if (lladdr) { - net_pkt_lladdr_dst(pkt)->addr = lladdr->addr; - net_pkt_lladdr_dst(pkt)->type = lladdr->type; - net_pkt_lladdr_dst(pkt)->len = lladdr->len; - } + net_pkt_lladdr_dst(pkt)->addr = lladdr->addr; + net_pkt_lladdr_dst(pkt)->type = lladdr->type; + net_pkt_lladdr_dst(pkt)->len = lladdr->len; net_pkt_set_iface(pkt, nbr->iface); From 1c18af6da7a67e0f5805839cbb573aa6a06b7efa Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 167/825] Revert "[nrf fromtree] drivers: flash: Do not select NRFX_RRAMC while building with TF-M" This reverts commit 695e4075161cf5749c1d82e06128c89d7f0470cc. --- drivers/flash/Kconfig.nrf_rram | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/flash/Kconfig.nrf_rram b/drivers/flash/Kconfig.nrf_rram index c8c83dfb240..0350771d2d0 100644 --- a/drivers/flash/Kconfig.nrf_rram +++ b/drivers/flash/Kconfig.nrf_rram @@ -8,7 +8,7 @@ menuconfig SOC_FLASH_NRF_RRAM bool "Nordic Semiconductor flash driver for nRF RRAM" default y depends on DT_HAS_NORDIC_RRAM_CONTROLLER_ENABLED - select NRFX_RRAMC if !BUILD_WITH_TFM + select NRFX_RRAMC select FLASH_HAS_DRIVER_ENABLED select FLASH_HAS_PAGE_LAYOUT select FLASH_NRF_FORCE_ALT From 9a9ea16841ffdc7cd882f6a57a2a1a2f8823cfc1 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 168/825] Revert "[nrf fromtree] soc: nordic: Fix APPROTECT with TF-M" This reverts commit 9e30235cce8e4b5df694d1f7689d7378ec8329cf. --- soc/nordic/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/soc/nordic/Kconfig b/soc/nordic/Kconfig index bb68a3f6110..ca0a152272e 100644 --- a/soc/nordic/Kconfig +++ b/soc/nordic/Kconfig @@ -98,7 +98,8 @@ config NFCT_PINS_AS_GPIOS choice NRF_APPROTECT_HANDLING bool "APPROTECT handling" depends on SOC_SERIES_NRF52X || SOC_NRF5340_CPUNET || \ - SOC_NRF5340_CPUAPP || SOC_SERIES_NRF91X + (SOC_NRF5340_CPUAPP && !TRUSTED_EXECUTION_NONSECURE) || \ + SOC_SERIES_NRF91X default NRF_APPROTECT_USE_UICR help Specifies how the SystemInit() function should handle the APPROTECT @@ -130,7 +131,7 @@ endchoice choice NRF_SECURE_APPROTECT_HANDLING bool "Secure APPROTECT handling" - depends on SOC_NRF5340_CPUAPP || SOC_SERIES_NRF91X + depends on (SOC_NRF5340_CPUAPP && !TRUSTED_EXECUTION_NONSECURE) default NRF_SECURE_APPROTECT_USE_UICR help Specifies how the SystemInit() function should handle the secure From 1326642a718b483d4e9b86c15f89bd42c6c7f4c6 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 169/825] Revert "[nrf fromtree] soc: nordic: nrf54h: Retrigger TASK_FREQ_CHANGE" This reverts commit 5aef526afbb7291f0ed492b9b87a6df1ed793f7d. --- soc/nordic/nrf54h/soc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index 7aa6985a05c..8b627279f06 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -98,8 +98,6 @@ static int trim_hsfll(void) DT_PROP(DT_CLOCKS_CTLR(HSFLL_NODE), clock_frequency)); nrf_hsfll_trim_set(hsfll, &trim); - nrf_hsfll_task_trigger(hsfll, NRF_HSFLL_TASK_FREQ_CHANGE); - /* HSFLL task frequency change needs to be triggered twice to take effect.*/ nrf_hsfll_task_trigger(hsfll, NRF_HSFLL_TASK_FREQ_CHANGE); LOG_DBG("NRF_HSFLL->TRIM.VSUP = %d", hsfll->TRIM.VSUP); From 64268c420f95d51c0889ee336121c172103d7598 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 170/825] Revert "[nrf noup] bluetooth: conn: Skip buffer ref count check in send_buf" This reverts commit 4f64a3afb9fd9a350ce471efbc029a3769a7d5b6. --- subsys/bluetooth/host/conn.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 07750f7708d..29f0cc556ec 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -654,17 +654,13 @@ 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. - * - * 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. - */ - __ASSERT_NO_MSG(IS_ENABLED(CONFIG_BT_ATT_SENT_CB_AFTER_TX) || (buf->ref == 1)); + if (buf->ref > 1 + (cb ? 1 : 0)) { + /* 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(false); + } if (buf->len > frag_len) { LOG_DBG("keep %p around", buf); From d05a10467953969502a2043f2ff5278e8047a7e6 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 171/825] Revert "[nrf fromlist] boards: nordic: nrf54h20dk: Add ETR buffer to memory map" This reverts commit 5708d4e344b853572de6dad5cbdd26335ac3ed35. --- .../nrf54h20dk_nrf54h20-memory_map.dtsi | 17 ----------------- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 4 ---- 2 files changed, 21 deletions(-) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi index 26a1e6fac74..834448f33e4 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-memory_map.dtsi @@ -51,23 +51,6 @@ }; }; - etr_buf_ram0x_region: memory@2f0be000 { - /* TODO to be reworked when SDFW with STM support is released.*/ - compatible = "nordic,owned-memory"; - reg = <0x2f0be000 DT_SIZE_K(4)>; - status = "disabled"; - perm-read; - perm-write; - perm-secure; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2f0be000 0x1000>; - - etr_buffer: memory@0 { - reg = <0x0 DT_SIZE_K(4)>; - }; - }; - cpuapp_cpurad_ram0x_region: memory@2f0bf000 { compatible = "nordic,owned-memory"; reg = <0x2f0bf000 DT_SIZE_K(4)>; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 3f30503800b..88342e03adc 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -121,10 +121,6 @@ status = "okay"; }; -&etr_buf_ram0x_region { - status = "okay"; -}; - &cpuapp_cpurad_ram0x_region { status = "okay"; }; From 0999fc184c7a90fa23e92ebc4c5f772af6ff6211 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 172/825] Revert "[nrf fromlist] dts: nordic: Add nrf-tbm (trace buffer monitor) node" This reverts commit e8ce359fd2c3a600efe67c925494cd61fbc005e8. --- dts/bindings/misc/nordic,nrf-tbm.yaml | 15 --------------- dts/common/nordic/nrf54h20.dtsi | 13 ------------- modules/hal_nordic/nrfx/CMakeLists.txt | 1 - modules/hal_nordic/nrfx/Kconfig | 4 ---- modules/hal_nordic/nrfx/nrfx_config.h | 4 ---- 5 files changed, 37 deletions(-) delete mode 100644 dts/bindings/misc/nordic,nrf-tbm.yaml diff --git a/dts/bindings/misc/nordic,nrf-tbm.yaml b/dts/bindings/misc/nordic,nrf-tbm.yaml deleted file mode 100644 index 46708250c25..00000000000 --- a/dts/bindings/misc/nordic,nrf-tbm.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: Nordic TBM (Trace Buffer Monitor) - -compatible: "nordic,nrf-tbm" - -include: base.yaml - -properties: - reg: - required: true - - interrupts: - required: true diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index 816a64da105..f57296e5cd0 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -355,19 +355,6 @@ }; }; - tdd_peripherals: peripheral@bf000000 { - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0xbf000000 0x1000000>; - - tbm: tbm@3000 { - compatible = "nordic,nrf-tbm"; - reg = <0x3000 0x408>; - status = "disabled"; - interrupts = <127 NRF_DEFAULT_IRQ_PRIORITY>; - }; - }; - global_peripherals: peripheral@5f000000 { #address-cells = <1>; #size-cells = <1>; diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 8383aee8779..2313c3f311d 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -117,7 +117,6 @@ zephyr_library_sources_ifdef(CONFIG_NRFX_SPI ${SRC_DIR}/nrfx_spi.c) zephyr_library_sources_ifdef(CONFIG_NRFX_SPIM ${SRC_DIR}/nrfx_spim.c) zephyr_library_sources_ifdef(CONFIG_NRFX_SPIS ${SRC_DIR}/nrfx_spis.c) zephyr_library_sources_ifdef(CONFIG_NRFX_SYSTICK ${SRC_DIR}/nrfx_systick.c) -zephyr_library_sources_ifdef(CONFIG_NRFX_TBM ${SRC_DIR}/nrfx_tbm.c) zephyr_library_sources_ifdef(CONFIG_NRFX_TEMP ${SRC_DIR}/nrfx_temp.c) zephyr_library_sources_ifdef(CONFIG_NRFX_TIMER ${SRC_DIR}/nrfx_timer.c) zephyr_library_sources_ifdef(CONFIG_NRFX_TWI ${SRC_DIR}/nrfx_twi.c) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 114988a945a..35c336f40ef 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -523,10 +523,6 @@ config NRFX_SYSTICK bool "SYSTICK driver" depends on CPU_CORTEX_M_HAS_SYSTICK -config NRFX_TBM - bool "TBM driver" - depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_TBM)) - config NRFX_TEMP bool "TEMP driver" depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_TEMP)) diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index 66b9bd99399..25da991b297 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -505,10 +505,6 @@ #define NRFX_SYSTICK_CONFIG_LOG_ENABLED 1 #endif -#ifdef CONFIG_NRFX_TBM -#define NRFX_TBM_ENABLED 1 -#endif - #ifdef CONFIG_NRFX_TEMP #define NRFX_TEMP_ENABLED 1 #endif From db7603a838f97fdc26eba88a28df42455d9aad64 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 173/825] Revert "[nrf noup] include: net: socket_ncs: remove deprecated RAI" This reverts commit 3b6c6e00baa6acd7a01753d7d6d0a31dca7f8920. --- include/zephyr/net/socket_ncs.h | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/include/zephyr/net/socket_ncs.h b/include/zephyr/net/socket_ncs.h index db3e0649c9f..0023cd9bd48 100644 --- a/include/zephyr/net/socket_ncs.h +++ b/include/zephyr/net/socket_ncs.h @@ -77,6 +77,41 @@ extern "C" { #define SO_KEEPOPEN 34 /** sockopt: bind to PDN */ #define SO_BINDTOPDN 40 +/** sockopt: Release Assistance Indication feature: This will indicate that the + * application will not send any more data. + * + * @note This socket option requires the socket to be connected. + * + * @deprecated use @ref SO_RAI with value @ref RAI_NO_DATA instead. + */ +#define SO_RAI_NO_DATA 50 +/** sockopt: Release Assistance Indication feature: This will indicate that the + * next call to send/sendto will be the last one for some time. + * + * @deprecated use @ref SO_RAI with value @ref RAI_LAST instead. + */ +#define SO_RAI_LAST 51 +/** sockopt: Release Assistance Indication feature: This will indicate that + * after the next call to send/sendto, the application is expecting to receive + * one more data packet before this socket will not be used again for some time. + * + * @deprecated use @ref SO_RAI with value @ref RAI_ONE_RESP instead. + */ +#define SO_RAI_ONE_RESP 52 +/** sockopt: Release Assistance Indication feature: If a client application + * expects to use the socket more it can indicate that by setting this socket + * option before the next send call which will keep the network up longer. + * + * @deprecated use @ref SO_RAI with value @ref RAI_ONGOING instead. + */ +#define SO_RAI_ONGOING 53 +/** sockopt: Release Assistance Indication feature: If a server application + * expects to use the socket more it can indicate that by setting this socket + * option before the next send call. + * + * @deprecated use @ref SO_RAI with value @ref RAI_WAIT_MORE instead. + */ +#define SO_RAI_WAIT_MORE 54 /** sockopt: Release assistance indication (RAI). * The option accepts an integer, indicating the type of RAI. From 2494c416d8e9350b41f4db35a549898ab5a7d24a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 174/825] Revert "[nrf noup] test-spec: update CI-boot-test" This reverts commit 98194577de1a3850de578da2a26c5f355e984090. --- .github/test-spec.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index a2bdaaf4d7f..f0c0cd9b133 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -38,15 +38,12 @@ "CI-lwm2m-test": null # Not necessary to run tests on changes to this repo. -"CI-boot-test": +"CI-boot-dfu-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/**/*" From 4d1ae795c7d28a8117b3a5ac6c4e325a48862af7 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:58 +0200 Subject: [PATCH 175/825] Revert "[nrf fromlist] drivers: watchdog: nrfx wdt without IRQs" This reverts commit 766b306bcbe819053d52717857d3228febe8ae43. --- drivers/watchdog/Kconfig.nrfx | 7 --- drivers/watchdog/wdt_nrfx.c | 78 +++++++++++++-------------- modules/hal_nordic/nrfx/nrfx_config.h | 3 -- 3 files changed, 37 insertions(+), 51 deletions(-) diff --git a/drivers/watchdog/Kconfig.nrfx b/drivers/watchdog/Kconfig.nrfx index ada1ef049ad..61f42d8ff31 100644 --- a/drivers/watchdog/Kconfig.nrfx +++ b/drivers/watchdog/Kconfig.nrfx @@ -19,10 +19,3 @@ config WDT_NRFX help Enable support for nrfx WDT driver for nRF MCU series. - -config WDT_NRFX_NO_IRQ - bool "nRF WDT nrfx driver without IRQ enabled" - depends on WDT_NRFX - - help - Disable use of WDT interrupt in driver. diff --git a/drivers/watchdog/wdt_nrfx.c b/drivers/watchdog/wdt_nrfx.c index b6cd802f405..1c23c9452b4 100644 --- a/drivers/watchdog/wdt_nrfx.c +++ b/drivers/watchdog/wdt_nrfx.c @@ -107,8 +107,7 @@ static int wdt_nrf_install_timeout(const struct device *dev, * the timeout) from range 0xF-0xFFFFFFFF given in 32768 Hz * clock ticks. This makes the allowed range of 0x1-0x07CFFFFF * in milliseconds. Check if the provided value is within - * this range. - */ + * this range. */ if ((cfg->window.max == 0U) || (cfg->window.max > 0x07CFFFFF)) { return -EINVAL; } @@ -156,7 +155,6 @@ static const struct wdt_driver_api wdt_nrfx_driver_api = { .feed = wdt_nrf_feed, }; -#if !defined(CONFIG_WDT_NRFX_NO_IRQ) static void wdt_event_handler(const struct device *dev, nrf_wdt_event_t event_type, uint32_t requests, void *p_context) { @@ -174,47 +172,45 @@ static void wdt_event_handler(const struct device *dev, nrf_wdt_event_t event_ty requests &= ~BIT(i); } } -#endif #define WDT(idx) DT_NODELABEL(wdt##idx) -#define WDT_NRFX_WDT_DEVICE(idx) \ - COND_CODE_0(IS_ENABLED(CONFIG_WDT_NRFX_NO_IRQ), ( \ - static void wdt_##idx##_event_handler(nrf_wdt_event_t event_type, \ - uint32_t requests, \ - void *p_context) \ - { \ - wdt_event_handler(DEVICE_DT_GET(WDT(idx)), event_type, \ - requests, p_context); \ - } \ - ), ()) \ - static int wdt_##idx##_init(const struct device *dev) \ - { \ - const struct wdt_nrfx_config *config = dev->config; \ - nrfx_err_t err_code; \ - COND_CODE_0(IS_ENABLED(CONFIG_WDT_NRFX_NO_IRQ), ( \ - IRQ_CONNECT(DT_IRQN(WDT(idx)), DT_IRQ(WDT(idx), \ - priority), nrfx_isr, nrfx_wdt_##idx##_irq_handler, 0);), ()) \ - err_code = nrfx_wdt_init(&config->wdt, \ - NULL, \ - COND_CODE_0(IS_ENABLED(CONFIG_WDT_NRFX_NO_IRQ), \ - (wdt_##idx##_event_handler,), (NULL,)) \ - NULL); \ - if (err_code != NRFX_SUCCESS) { \ - return -EBUSY; \ - } \ - return 0; \ - } \ - static struct wdt_nrfx_data wdt_##idx##_data; \ - static const struct wdt_nrfx_config wdt_##idx##z_config = { \ - .wdt = NRFX_WDT_INSTANCE(idx), \ - }; \ - DEVICE_DT_DEFINE(WDT(idx), \ - wdt_##idx##_init, \ - NULL, \ - &wdt_##idx##_data, \ - &wdt_##idx##z_config, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ +#define WDT_NRFX_WDT_DEVICE(idx) \ + static void wdt_##idx##_event_handler(nrf_wdt_event_t event_type, \ + uint32_t requests, \ + void *p_context) \ + { \ + wdt_event_handler(DEVICE_DT_GET(WDT(idx)), event_type, \ + requests, p_context); \ + } \ + static int wdt_##idx##_init(const struct device *dev) \ + { \ + const struct wdt_nrfx_config *config = dev->config; \ + nrfx_err_t err_code; \ + IRQ_CONNECT(DT_IRQN(WDT(idx)), DT_IRQ(WDT(idx), priority), \ + nrfx_isr, nrfx_wdt_##idx##_irq_handler, 0); \ + err_code = nrfx_wdt_init(&config->wdt, \ + NULL, \ + wdt_##idx##_event_handler, \ + NULL); \ + if (err_code != NRFX_SUCCESS) { \ + return -EBUSY; \ + } \ + return 0; \ + } \ + static struct wdt_nrfx_data wdt_##idx##_data = { \ + .m_timeout = 0, \ + .m_allocated_channels = 0, \ + }; \ + static const struct wdt_nrfx_config wdt_##idx##z_config = { \ + .wdt = NRFX_WDT_INSTANCE(idx), \ + }; \ + DEVICE_DT_DEFINE(WDT(idx), \ + wdt_##idx##_init, \ + NULL, \ + &wdt_##idx##_data, \ + &wdt_##idx##z_config, \ + PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ &wdt_nrfx_driver_api) #ifdef CONFIG_HAS_HW_NRF_WDT0 diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index 25da991b297..a66cacc148e 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -813,9 +813,6 @@ #ifdef CONFIG_NRFX_WDT #define NRFX_WDT_ENABLED 1 #endif -#ifdef CONFIG_WDT_NRFX_NO_IRQ -#define NRFX_WDT_CONFIG_NO_IRQ 1 -#endif #ifdef CONFIG_NRFX_WDT_LOG #define NRFX_WDT_CONFIG_LOG_ENABLED 1 #endif From 558ebdced124d778b650c38eeb5c29fca8c75d4b Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 176/825] Revert "[nrf fromtree] bluetooth: shell: Add shell commands for LE Connection Subrating" This reverts commit 64796d7323b1ae58b29542c48a7bf9a0f8d241c1. --- subsys/bluetooth/shell/bt.c | 108 ---------------------------- tests/bluetooth/shell/testcase.yaml | 7 -- 2 files changed, 115 deletions(-) diff --git a/subsys/bluetooth/shell/bt.c b/subsys/bluetooth/shell/bt.c index ae80938a51a..95766335bee 100644 --- a/subsys/bluetooth/shell/bt.c +++ b/subsys/bluetooth/shell/bt.c @@ -982,27 +982,6 @@ void path_loss_threshold_report(struct bt_conn *conn, } #endif -#if defined(CONFIG_BT_SUBRATING) -void subrate_changed(struct bt_conn *conn, - const struct bt_conn_le_subrate_changed *params) -{ - if (params->status == BT_HCI_ERR_SUCCESS) { - shell_print(ctx_shell, "Subrate parameters changed: " - "Subrate Factor: %d " - "Continuation Number: %d " - "Peripheral latency: 0x%04x " - "Supervision timeout: 0x%04x (%d ms)", - params->factor, - params->continuation_number, - params->peripheral_latency, - params->supervision_timeout, - params->supervision_timeout * 10); - } else { - shell_print(ctx_shell, "Subrate change failed (HCI status 0x%02x)", params->status); - } -} -#endif - static struct bt_conn_cb conn_callbacks = { .connected = connected, .disconnected = disconnected, @@ -1029,9 +1008,6 @@ static struct bt_conn_cb conn_callbacks = { #if defined(CONFIG_BT_PATH_LOSS_MONITORING) .path_loss_threshold_report = path_loss_threshold_report, #endif -#if defined(CONFIG_BT_SUBRATING) - .subrate_changed = subrate_changed, -#endif }; #endif /* CONFIG_BT_CONN */ @@ -3046,74 +3022,6 @@ static int cmd_set_path_loss_reporting_enable(const struct shell *sh, size_t arg } #endif -#if defined(CONFIG_BT_SUBRATING) -static int cmd_subrate_set_defaults(const struct shell *sh, size_t argc, char *argv[]) -{ - int err = 0; - - for (size_t argn = 1; argn < argc; argn++) { - (void)shell_strtoul(argv[argn], 10, &err); - - if (err) { - shell_help(sh); - shell_error(sh, "Could not parse input number %d", argn); - return SHELL_CMD_HELP_PRINTED; - } - } - - const struct bt_conn_le_subrate_param params = { - .subrate_min = shell_strtoul(argv[1], 10, &err), - .subrate_max = shell_strtoul(argv[2], 10, &err), - .max_latency = shell_strtoul(argv[3], 10, &err), - .continuation_number = shell_strtoul(argv[4], 10, &err), - .supervision_timeout = shell_strtoul(argv[5], 10, &err) * 100, /* 10ms units */ - }; - - err = bt_conn_le_subrate_set_defaults(¶ms); - if (err) { - shell_error(sh, "bt_conn_le_subrate_set_defaults returned error %d", err); - return -ENOEXEC; - } - - return 0; -} - -static int cmd_subrate_request(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; - } - - for (size_t argn = 1; argn < argc; argn++) { - (void)shell_strtoul(argv[argn], 10, &err); - - if (err) { - shell_help(sh); - shell_error(sh, "Could not parse input number %d", argn); - return SHELL_CMD_HELP_PRINTED; - } - } - - const struct bt_conn_le_subrate_param params = { - .subrate_min = shell_strtoul(argv[1], 10, &err), - .subrate_max = shell_strtoul(argv[2], 10, &err), - .max_latency = shell_strtoul(argv[3], 10, &err), - .continuation_number = shell_strtoul(argv[4], 10, &err), - .supervision_timeout = shell_strtoul(argv[5], 10, &err) * 100, /* 10ms units */ - }; - - err = bt_conn_le_subrate_request(default_conn, ¶ms); - if (err) { - shell_error(sh, "bt_conn_le_subrate_request returned error %d", err); - return -ENOEXEC; - } - - return 0; -} -#endif #if defined(CONFIG_BT_CONN) #if defined(CONFIG_BT_CENTRAL) @@ -3410,12 +3318,6 @@ static int cmd_info(const struct shell *sh, size_t argc, char *argv[]) info.le.data_len->tx_max_time, info.le.data_len->rx_max_len, info.le.data_len->rx_max_time); -#endif -#if defined(CONFIG_BT_SUBRATING) - shell_print(ctx_shell, "LE Subrating: Subrate Factor: %d" - " Continuation Number: %d", - info.le.subrate->factor, - info.le.subrate->continuation_number); #endif } @@ -4817,16 +4719,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds, SHELL_CMD_ARG(path-loss-monitoring-enable, NULL, "", cmd_set_path_loss_reporting_enable, 2, 0), #endif -#if defined(CONFIG_BT_SUBRATING) - SHELL_CMD_ARG(subrate-set-defaults, NULL, - " " - " ", - cmd_subrate_set_defaults, 6, 0), - SHELL_CMD_ARG(subrate-request, NULL, - " " - " ", - cmd_subrate_request, 6, 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 eb6c7412053..3ddde520a86 100644 --- a/tests/bluetooth/shell/testcase.yaml +++ b/tests/bluetooth/shell/testcase.yaml @@ -29,13 +29,6 @@ tests: platform_allow: - native_posix build_only: true - bluetooth.shell.subrating: - extra_configs: - - CONFIG_BT_SUBRATING=y - - CONFIG_BT_CTLR=n - platform_allow: - - native_posix - build_only: true bluetooth.shell.cdc_acm: extra_args: - OVERLAY_CONFIG=cdc_acm.conf From 11da482011a056f1391b2aad8f5eefef46241c0d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 177/825] Revert "[nrf fromtree] bluetooth: host: Add support for LE Connection Subrating" This reverts commit 1c041e81d6e96ae0a70dca4fccadc2a7dbb8c378. --- include/zephyr/bluetooth/conn.h | 101 ------------------------ include/zephyr/bluetooth/hci_types.h | 31 -------- subsys/bluetooth/host/conn.c | 106 -------------------------- subsys/bluetooth/host/conn_internal.h | 7 -- subsys/bluetooth/host/hci_core.c | 57 -------------- 5 files changed, 302 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 0f5a4758109..642aea95b6d 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -196,57 +196,6 @@ struct bt_conn_le_data_len_param { BT_CONN_LE_DATA_LEN_PARAM(BT_GAP_DATA_LEN_MAX, \ BT_GAP_DATA_TIME_MAX) -/** Connection subrating parameters for LE connections */ -struct bt_conn_le_subrate_param { - /** Minimum subrate factor. */ - uint16_t subrate_min; - /** Maximum subrate factor. */ - uint16_t subrate_max; - /** Maximum Peripheral latency in units of subrated connection intervals. */ - uint16_t max_latency; - /** Minimum number of underlying connection events to remain active - * after a packet containing a Link Layer PDU with a non-zero Length - * field is sent or received. - */ - uint16_t continuation_number; - /** Connection Supervision timeout (N * 10 ms). - * If using @ref bt_conn_le_subrate_set_defaults, this is the - * maximum supervision timeout allowed in requests by a peripheral. - */ - uint16_t supervision_timeout; -}; - -/** Subrating information for LE connections */ -struct bt_conn_le_subrating_info { - /** Connection subrate factor. */ - uint16_t factor; - /** Number of underlying connection events to remain active after - * a packet containing a Link Layer PDU with a non-zero Length - * field is sent or received. - */ - uint16_t continuation_number; -}; - -/** Updated subrating connection parameters for LE connections */ -struct bt_conn_le_subrate_changed { - /** HCI Status from LE Subrate Changed event. - * The remaining parameters will be unchanged if status is not - * BT_HCI_ERR_SUCCESS. - */ - uint8_t status; - /** Connection subrate factor. */ - uint16_t factor; - /** Number of underlying connection events to remain active after - * a packet containing a Link Layer PDU with a non-zero Length - * field is sent or received. - */ - uint16_t continuation_number; - /** Peripheral latency in units of subrated connection intervals. */ - uint16_t peripheral_latency; - /** Connection Supervision timeout (N * 10 ms). */ - uint16_t supervision_timeout; -}; - /** Connection Type */ enum __packed bt_conn_type { /** LE Connection Type */ @@ -361,11 +310,6 @@ struct bt_conn_le_info { /* Connection maximum single fragment parameters */ const struct bt_conn_le_data_len_info *data_len; #endif /* defined(CONFIG_BT_USER_DATA_LEN_UPDATE) */ - -#if defined(CONFIG_BT_SUBRATING) - /* Connection subrating parameters */ - const struct bt_conn_le_subrating_info *subrate; -#endif /* defined(CONFIG_BT_SUBRATING) */ }; /** @brief Convert connection interval to milliseconds @@ -736,36 +680,6 @@ int bt_conn_le_set_path_loss_mon_param(struct bt_conn *conn, */ int bt_conn_le_set_path_loss_mon_enable(struct bt_conn *conn, bool enable); -/** @brief Set Default Connection Subrating Parameters. - * - * Change the default subrating parameters for all future - * ACL connections where the local device is the central. - * This command does not affect any existing connection. - * Parameters set for specific connection will always have precedence. - * - * @note To use this API @kconfig{CONFIG_BT_SUBRATING} and - * @kconfig{CONFIG_BT_CENTRAL} must be set. - * - * @param params Subrating parameters. - * - * @return Zero on success or (negative) error code on failure. - */ -int bt_conn_le_subrate_set_defaults(const struct bt_conn_le_subrate_param *params); - -/** @brief Request New Subrating Parameters. - * - * Request a change to the subrating parameters of a connection. - * - * @note To use this API @kconfig{CONFIG_BT_SUBRATING} must be set. - * - * @param conn Connection object. - * @param params Subrating parameters. - * - * @return Zero on success or (negative) error code on failure. - */ -int bt_conn_le_subrate_request(struct bt_conn *conn, - const struct bt_conn_le_subrate_param *params); - /** @brief Update the connection parameters. * * If the local device is in the peripheral role then updating the connection @@ -1334,21 +1248,6 @@ struct bt_conn_cb { const struct bt_conn_le_path_loss_threshold_report *report); #endif /* CONFIG_BT_PATH_LOSS_MONITORING */ -#if defined(CONFIG_BT_SUBRATING) - /** @brief LE Subrate Changed event. - * - * This callback notifies the application that the subrating parameters - * of the connection may have changed. - * The connection subrating parameters will be unchanged - * if status is not BT_HCI_ERR_SUCCESS. - * - * @param conn Connection object. - * @param params New subrating parameters. - */ - void (*subrate_changed)(struct bt_conn *conn, - const struct bt_conn_le_subrate_changed *params); -#endif /* CONFIG_BT_SUBRATING */ - /** @internal Internally used field for list handling */ sys_snode_t _node; }; diff --git a/include/zephyr/bluetooth/hci_types.h b/include/zephyr/bluetooth/hci_types.h index 764846cfcea..1aa5aa915a3 100644 --- a/include/zephyr/bluetooth/hci_types.h +++ b/include/zephyr/bluetooth/hci_types.h @@ -704,26 +704,6 @@ struct bt_hci_cp_le_set_path_loss_reporting_enable { #define BT_HCI_LE_PATH_LOSS_REPORTING_ENABLE 0x01 #define BT_HCI_OP_LE_SET_PATH_LOSS_REPORTING_ENABLE BT_OP(BT_OGF_LE, 0x0079) /* 0x2079 */ -struct bt_hci_cp_le_set_default_subrate { - uint16_t subrate_min; - uint16_t subrate_max; - uint16_t max_latency; - uint16_t continuation_number; - uint16_t supervision_timeout; -} __packed; - -struct bt_hci_cp_le_subrate_request { - uint16_t handle; - uint16_t subrate_min; - uint16_t subrate_max; - uint16_t max_latency; - uint16_t continuation_number; - uint16_t supervision_timeout; -} __packed; - -#define BT_HCI_OP_LE_SET_DEFAULT_SUBRATE BT_OP(BT_OGF_LE, 0x007D) /* 0x207D */ -#define BT_HCI_OP_LE_SUBRATE_REQUEST BT_OP(BT_OGF_LE, 0x007E) /* 0x207E */ - #define BT_HCI_CTL_TO_HOST_FLOW_DISABLE 0x00 #define BT_HCI_CTL_TO_HOST_FLOW_ENABLE 0x01 #define BT_HCI_OP_SET_CTL_TO_HOST_FLOW BT_OP(BT_OGF_BASEBAND, 0x0031) /* 0x0c31 */ @@ -3118,16 +3098,6 @@ struct bt_hci_evt_le_biginfo_adv_report { uint8_t encryption; } __packed; -#define BT_HCI_EVT_LE_SUBRATE_CHANGE 0x23 -struct bt_hci_evt_le_subrate_change { - uint8_t status; - uint16_t handle; - uint16_t subrate_factor; - uint16_t peripheral_latency; - uint16_t continuation_number; - uint16_t supervision_timeout; -} __packed; - /* Event mask bits */ #define BT_EVT_BIT(n) (1ULL << (n)) @@ -3208,7 +3178,6 @@ struct bt_hci_evt_le_subrate_change { #define BT_EVT_MASK_LE_PATH_LOSS_THRESHOLD BT_EVT_BIT(31) #define BT_EVT_MASK_LE_TRANSMIT_POWER_REPORTING BT_EVT_BIT(32) #define BT_EVT_MASK_LE_BIGINFO_ADV_REPORT BT_EVT_BIT(33) -#define BT_EVT_MASK_LE_SUBRATE_CHANGE BT_EVT_BIT(34) #define BT_EVT_MASK_LE_PER_ADV_SYNC_ESTABLISHED_V2 BT_EVT_BIT(35) #define BT_EVT_MASK_LE_PER_ADVERTISING_REPORT_V2 BT_EVT_BIT(36) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 29f0cc556ec..bf84872b89c 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2737,9 +2737,6 @@ int bt_conn_get_info(const struct bt_conn *conn, struct bt_conn_info *info) #endif #if defined(CONFIG_BT_USER_DATA_LEN_UPDATE) info->le.data_len = &conn->le.data_len; -#endif -#if defined(CONFIG_BT_SUBRATING) - info->le.subrate = &conn->le.subrate; #endif if (conn->le.keys && (conn->le.keys->flags & BT_KEYS_SC)) { info->security.flags |= BT_SECURITY_FLAG_SC; @@ -3025,109 +3022,6 @@ int bt_conn_le_set_path_loss_mon_enable(struct bt_conn *conn, bool reporting_ena } #endif /* CONFIG_BT_PATH_LOSS_MONITORING */ -#if defined(CONFIG_BT_SUBRATING) -void notify_subrate_change(struct bt_conn *conn, - const struct bt_conn_le_subrate_changed params) -{ - struct bt_conn_cb *callback; - - SYS_SLIST_FOR_EACH_CONTAINER(&conn_cbs, callback, _node) { - if (callback->subrate_changed) { - callback->subrate_changed(conn, ¶ms); - } - } - - STRUCT_SECTION_FOREACH(bt_conn_cb, cb) - { - if (cb->subrate_changed) { - cb->subrate_changed(conn, ¶ms); - } - } -} - -static bool le_subrate_common_params_valid(const struct bt_conn_le_subrate_param *param) -{ - /* All limits according to BT Core spec 5.4 [Vol 4, Part E, 7.8.123] */ - - if (param->subrate_min < 0x0001 || param->subrate_min > 0x01F4 || - param->subrate_max < 0x0001 || param->subrate_max > 0x01F4 || - param->subrate_min > param->subrate_max) { - return false; - } - - if (param->max_latency > 0x01F3 || - param->subrate_max * (param->max_latency + 1) > 500) { - return false; - } - - if (param->continuation_number > 0x01F3 || - param->continuation_number >= param->subrate_max) { - return false; - } - - if (param->supervision_timeout < 0x000A || - param->supervision_timeout > 0xC80) { - return false; - } - - return true; -} - -int bt_conn_le_subrate_set_defaults(const struct bt_conn_le_subrate_param *params) -{ - struct bt_hci_cp_le_set_default_subrate *cp; - struct net_buf *buf; - - if (!IS_ENABLED(CONFIG_BT_CENTRAL)) { - return -ENOTSUP; - } - - if (!le_subrate_common_params_valid(params)) { - return -EINVAL; - } - - buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_DEFAULT_SUBRATE, sizeof(*cp)); - if (!buf) { - return -ENOBUFS; - } - - cp = net_buf_add(buf, sizeof(*cp)); - cp->subrate_min = sys_cpu_to_le16(params->subrate_min); - cp->subrate_max = sys_cpu_to_le16(params->subrate_max); - cp->max_latency = sys_cpu_to_le16(params->max_latency); - cp->continuation_number = sys_cpu_to_le16(params->continuation_number); - cp->supervision_timeout = sys_cpu_to_le16(params->supervision_timeout); - - return bt_hci_cmd_send_sync(BT_HCI_OP_LE_SET_DEFAULT_SUBRATE, buf, NULL); -} - -int bt_conn_le_subrate_request(struct bt_conn *conn, - const struct bt_conn_le_subrate_param *params) -{ - struct bt_hci_cp_le_subrate_request *cp; - struct net_buf *buf; - - if (!le_subrate_common_params_valid(params)) { - return -EINVAL; - } - - buf = bt_hci_cmd_create(BT_HCI_OP_LE_SUBRATE_REQUEST, sizeof(*cp)); - if (!buf) { - return -ENOBUFS; - } - - cp = net_buf_add(buf, sizeof(*cp)); - cp->handle = sys_cpu_to_le16(conn->handle); - cp->subrate_min = sys_cpu_to_le16(params->subrate_min); - cp->subrate_max = sys_cpu_to_le16(params->subrate_max); - cp->max_latency = sys_cpu_to_le16(params->max_latency); - cp->continuation_number = sys_cpu_to_le16(params->continuation_number); - cp->supervision_timeout = sys_cpu_to_le16(params->supervision_timeout); - - return bt_hci_cmd_send_sync(BT_HCI_OP_LE_SUBRATE_REQUEST, buf, NULL); -} -#endif /* CONFIG_BT_SUBRATING */ - int bt_conn_le_param_update(struct bt_conn *conn, const struct bt_le_conn_param *param) { diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index fdf92eba133..61664048cd7 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -114,10 +114,6 @@ struct bt_conn_le { #if defined(CONFIG_BT_USER_DATA_LEN_UPDATE) struct bt_conn_le_data_len_info data_len; #endif - -#if defined(CONFIG_BT_SUBRATING) - struct bt_conn_le_subrating_info subrate; -#endif }; #if defined(CONFIG_BT_CLASSIC) @@ -478,9 +474,6 @@ void notify_tx_power_report(struct bt_conn *conn, void notify_path_loss_threshold_report(struct bt_conn *conn, struct bt_conn_le_path_loss_threshold_report report); -void notify_subrate_change(struct bt_conn *conn, - struct bt_conn_le_subrate_changed params); - #if defined(CONFIG_BT_SMP) /* If role specific LTK is present */ bool bt_conn_ltk_present(const struct bt_conn *conn); diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index fdabf1e3ef5..00b106d5ecb 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1378,10 +1378,6 @@ static void update_conn(struct bt_conn *conn, const bt_addr_le_t *id_addr, conn->le.data_len.rx_max_len = BT_GAP_DATA_LEN_DEFAULT; conn->le.data_len.rx_max_time = BT_GAP_DATA_TIME_DEFAULT; #endif -#if defined(CONFIG_BT_SUBRATING) - conn->le.subrate.factor = 1; /* No subrating. */ - conn->le.subrate.continuation_number = 0; -#endif } void bt_hci_le_enh_conn_complete(struct bt_hci_evt_le_enh_conn_complete *evt) @@ -2650,41 +2646,6 @@ void bt_hci_le_path_loss_threshold_event(struct net_buf *buf) } #endif /* CONFIG_BT_PATH_LOSS_MONITORING */ -#if defined(CONFIG_BT_SUBRATING) -void bt_hci_le_subrate_change_event(struct net_buf *buf) -{ - struct bt_hci_evt_le_subrate_change *evt; - struct bt_conn_le_subrate_changed params; - struct bt_conn *conn; - - evt = net_buf_pull_mem(buf, sizeof(*evt)); - - conn = bt_conn_lookup_handle(sys_le16_to_cpu(evt->handle), BT_CONN_TYPE_LE); - if (!conn) { - LOG_ERR("Unknown conn handle 0x%04X for subrating event", - sys_le16_to_cpu(evt->handle)); - return; - } - - if (evt->status == BT_HCI_ERR_SUCCESS) { - conn->le.subrate.factor = sys_le16_to_cpu(evt->subrate_factor); - conn->le.subrate.continuation_number = sys_le16_to_cpu(evt->continuation_number); - conn->le.latency = sys_le16_to_cpu(evt->peripheral_latency); - conn->le.timeout = sys_le16_to_cpu(evt->supervision_timeout); - } - - params.status = evt->status; - params.factor = conn->le.subrate.factor; - params.continuation_number = conn->le.subrate.continuation_number; - params.peripheral_latency = conn->le.latency; - params.supervision_timeout = conn->le.timeout; - - notify_subrate_change(conn, params); - - bt_conn_unref(conn); -} -#endif /* CONFIG_BT_SUBRATING */ - static const struct event_handler vs_events[] = { #if defined(CONFIG_BT_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES) EVENT_HANDLER(BT_HCI_EVT_VS_LE_CONNECTIONLESS_IQ_REPORT, @@ -2838,10 +2799,6 @@ static const struct event_handler meta_events[] = { EVENT_HANDLER(BT_HCI_EVT_LE_PATH_LOSS_THRESHOLD, bt_hci_le_path_loss_threshold_event, sizeof(struct bt_hci_evt_le_path_loss_threshold)), #endif /* CONFIG_BT_PATH_LOSS_MONITORING */ -#if defined(CONFIG_BT_SUBRATING) - EVENT_HANDLER(BT_HCI_EVT_LE_SUBRATE_CHANGE, bt_hci_le_subrate_change_event, - sizeof(struct bt_hci_evt_le_subrate_change)), -#endif /* CONFIG_BT_PATH_LOSS_MONITORING */ #if defined(CONFIG_BT_PER_ADV_SYNC_RSP) EVENT_HANDLER(BT_HCI_EVT_LE_PER_ADVERTISING_REPORT_V2, bt_hci_le_per_adv_report_v2, sizeof(struct bt_hci_evt_le_per_advertising_report_v2)), @@ -3360,11 +3317,6 @@ static int le_set_event_mask(void) if (IS_ENABLED(CONFIG_BT_PATH_LOSS_MONITORING)) { mask |= BT_EVT_MASK_LE_PATH_LOSS_THRESHOLD; } - - if (IS_ENABLED(CONFIG_BT_SUBRATING) && - BT_FEAT_LE_CONN_SUBRATING(bt_dev.le.features)) { - mask |= BT_EVT_MASK_LE_SUBRATE_CHANGE; - } } if (IS_ENABLED(CONFIG_BT_SMP) && @@ -3649,15 +3601,6 @@ static int le_init(void) } #endif /* CONFIG_BT_DF */ - if (IS_ENABLED(CONFIG_BT_SUBRATING) && - BT_FEAT_LE_CONN_SUBRATING(bt_dev.le.features)) { - /* Connection Subrating (Host Support) */ - err = le_set_host_feature(BT_LE_FEAT_BIT_CONN_SUBRATING_HOST_SUPP, 1); - if (err) { - return err; - } - } - return le_set_event_mask(); } From 7de93715c24697e81774a37462cf0239bdf185df Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 178/825] Revert "[nrf fromtree] bluetooth: Add Kconfig for LE Connection Subrating" This reverts commit 479bb8c9bdb2e50914c70d1a772a8df8ee13f7eb. --- subsys/bluetooth/Kconfig | 8 -------- subsys/bluetooth/controller/Kconfig | 1 - 2 files changed, 9 deletions(-) diff --git a/subsys/bluetooth/Kconfig b/subsys/bluetooth/Kconfig index ee2a96bb97f..5e1de57db08 100644 --- a/subsys/bluetooth/Kconfig +++ b/subsys/bluetooth/Kconfig @@ -181,14 +181,6 @@ config BT_PATH_LOSS_MONITORING Enable support for LE Path Loss Monitoring feature that is defined in the Bluetooth Core specification, Version 5.4 | Vol 6, Part B, Section 4.6.32. -config BT_SUBRATING - bool "LE Connection Subrating [EXPERIMENTAL]" - select EXPERIMENTAL - depends on !BT_CTLR || BT_CTLR_SUBRATING_SUPPORT - help - 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. - endif # BT_CONN rsource "Kconfig.iso" diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 19ecd1bf2bc..46910626994 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -1025,7 +1025,6 @@ config BT_CTLR_SUBRATING bool "LE Connection Subrating" depends on BT_CTLR_SUBRATING_SUPPORT select BT_CTLR_SET_HOST_FEATURE - default y if BT_SUBRATING help Enable support for Bluetooth v5.3 LE Connection Subrating in the Controller. From f216d8fce5953f02d57944fe0f284519c7b455a5 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 179/825] Revert "[nrf fromlist] tests: adc_api: add channel for" This reverts commit 27e7602f5a629ee219d44cb7a7dfe7f426c5b693. --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 11 +---------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.overlay | 13 ++----------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/tests/drivers/adc/adc_api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/adc/adc_api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 536366ec8d5..c80a7459f13 100644 --- a/tests/drivers/adc/adc_api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/adc/adc_api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -6,7 +6,7 @@ / { zephyr,user { - io-channels = <&adc 0>, <&adc 1>, <&adc 2>; + io-channels = <&adc 0>, <&adc 2>; }; }; @@ -23,15 +23,6 @@ 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"; diff --git a/tests/drivers/adc/adc_api/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/tests/drivers/adc/adc_api/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay index 2a78a0c21f6..cfd54f1ba7f 100644 --- a/tests/drivers/adc/adc_api/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/adc/adc_api/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -6,7 +6,7 @@ / { zephyr,user { - io-channels = <&adc 0>, <&adc 1>, <&adc 2>; + io-channels = <&adc 0>, <&adc 2>; }; }; @@ -23,18 +23,9 @@ 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_5"; + zephyr,gain = "ADC_GAIN_2_3"; zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = ; zephyr,input-positive = ; From c64709288cb723b0171e714344560aaaa575bd31 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 180/825] Revert "[nrf fromlist] tests: drivers: adc_accuracy: add calibration before" This reverts commit 7534f8f1a7fefa7e5a17385f07288b9fb451097a. --- tests/drivers/adc/adc_accuracy_test/src/ref_volt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/drivers/adc/adc_accuracy_test/src/ref_volt.c b/tests/drivers/adc/adc_accuracy_test/src/ref_volt.c index 9679720c51e..66eaddd5b03 100644 --- a/tests/drivers/adc/adc_accuracy_test/src/ref_volt.c +++ b/tests/drivers/adc/adc_accuracy_test/src/ref_volt.c @@ -20,7 +20,6 @@ static int test_ref_to_adc(void) struct adc_sequence sequence = { .buffer = &sample_buffer, .buffer_size = sizeof(sample_buffer), - .calibrate = true, }; const struct adc_dt_spec *adc_channel = get_adc_channel(); From db277123244456833f05cc686e34c71158f1e1ca Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 181/825] Revert "[nrf fromtree] manifest: Update nRF hw models to latest" This reverts commit 85ca81f02ca7990d6e71c1f08fbcce3c85ff7565. --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index b77d741b71d..6305bc157b5 100644 --- a/west.yml +++ b/west.yml @@ -295,7 +295,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: 3ede17158a9fe85c160e0384c0ad0306e24ee47e + revision: 6c389b9b5fa0a079cd4502e69d375da4c0c289b7 path: modules/bsim_hw_models/nrf_hw_models - name: open-amp revision: da78aea63159771956fe0c9263f2e6985b66e9d5 From 2c652a164c81d923674909491c29fae4229ac30d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 182/825] Revert "[nrf fromtree] manifest: Update nRF hw models to latest" This reverts commit fbe0c5aca16318171ae9a7c81b55bd65fd2befc8. --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 6305bc157b5..603bb7d8b5f 100644 --- a/west.yml +++ b/west.yml @@ -295,7 +295,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: 6c389b9b5fa0a079cd4502e69d375da4c0c289b7 + revision: 4447a22aea5e791c9bd18e7d71cc092623ddd2bb path: modules/bsim_hw_models/nrf_hw_models - name: open-amp revision: da78aea63159771956fe0c9263f2e6985b66e9d5 From 314840ec00cfa0806d5fa5c306695a2af1101e6a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 183/825] Revert "[nrf fromtree] manifest: Update nRF hw models to latest" This reverts commit 9cde3785edef923af777078de6a141c8611dbb6e. --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 603bb7d8b5f..2b19ad5b2a0 100644 --- a/west.yml +++ b/west.yml @@ -295,7 +295,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: 4447a22aea5e791c9bd18e7d71cc092623ddd2bb + revision: 53635212495e4575955fc717369be4362126456a path: modules/bsim_hw_models/nrf_hw_models - name: open-amp revision: da78aea63159771956fe0c9263f2e6985b66e9d5 From 785fbb6334e0f4ac6b1219fa06c89c153c9d5c89 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 184/825] Revert "[nrf fromtree] manifest: Update nRF hw models to latest" This reverts commit 9adafaa0e14b3019684a8eadbaa6e612931cf94e. --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 2b19ad5b2a0..90283c1b7ab 100644 --- a/west.yml +++ b/west.yml @@ -295,7 +295,7 @@ manifest: groups: - tools - name: nrf_hw_models - revision: 53635212495e4575955fc717369be4362126456a + revision: 36b12714a5ed32450d907c89bb118f6280da3483 path: modules/bsim_hw_models/nrf_hw_models - name: open-amp revision: da78aea63159771956fe0c9263f2e6985b66e9d5 From 8e99a7fcc2ed6e56ceabbed4c88cf8d5f9766c1e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 185/825] Revert "[nrf fromtree] Bluetooth: DIS: integrate app version into FW revision characteristic" This reverts commit bc15a7e16a7266f66a229d1673177e45f0457652. --- subsys/bluetooth/services/Kconfig.dis | 2 -- 1 file changed, 2 deletions(-) diff --git a/subsys/bluetooth/services/Kconfig.dis b/subsys/bluetooth/services/Kconfig.dis index 2a6c6bba74e..d5484710e82 100644 --- a/subsys/bluetooth/services/Kconfig.dis +++ b/subsys/bluetooth/services/Kconfig.dis @@ -117,8 +117,6 @@ config BT_DIS_FW_REV config BT_DIS_FW_REV_STR string "Firmware revision" depends on BT_DIS_FW_REV - default "$(APP_VERSION_TWEAK_STRING)" if "$(VERSION_MAJOR)" != "" - default "0.0.0+0" help Enable firmware revision characteristic in Device Information Service. From 3b7e84f24402098a5c512cb4e5eea926b29f3092 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 186/825] Revert "[nrf fromtree] Bluetooth: HCI: Expose bt_hci_conn_lookup_handle()" This reverts commit 65acb953582beb2ceaba8e4e458df019c245f74f. --- include/zephyr/bluetooth/hci.h | 12 ------------ subsys/bluetooth/host/conn.c | 5 ----- 2 files changed, 17 deletions(-) diff --git a/include/zephyr/bluetooth/hci.h b/include/zephyr/bluetooth/hci.h index decc856d7ec..e321536d1e0 100644 --- a/include/zephyr/bluetooth/hci.h +++ b/include/zephyr/bluetooth/hci.h @@ -113,18 +113,6 @@ int bt_hci_cmd_send_sync(uint16_t opcode, struct net_buf *buf, */ int bt_hci_get_conn_handle(const struct bt_conn *conn, uint16_t *conn_handle); -/** @brief Get connection given a connection handle. - * - * The caller gets a new reference to the connection object which must be - * released with bt_conn_unref() once done using the object. - * - * @param handle The connection handle - * - * @returns The corresponding connection object on success. - * NULL if it does not exist. - */ -struct bt_conn *bt_hci_conn_lookup_handle(uint16_t handle); - /** @brief Get advertising handle for an advertising set. * * @param adv Advertising set. diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index bf84872b89c..2e346b7dcc2 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1355,11 +1355,6 @@ struct bt_conn *bt_conn_lookup_handle(uint16_t handle, enum bt_conn_type type) return NULL; } -struct bt_conn *bt_hci_conn_lookup_handle(uint16_t handle) -{ - return bt_conn_lookup_handle(handle, BT_CONN_TYPE_ALL); -} - void bt_conn_foreach(enum bt_conn_type type, void (*func)(struct bt_conn *conn, void *data), void *data) From 806b4377a319d364470b774e91e98a16176f7548 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 187/825] Revert "[nrf fromtree] Bluetooth: HCI: Expose bt_hci_per_adv_sync_lookup_handle()" This reverts commit 2071857f27a326d9b1b5a88f6634a92da7cf97f1. --- include/zephyr/bluetooth/hci.h | 9 --------- subsys/bluetooth/host/direction.c | 4 ++-- subsys/bluetooth/host/hci_core.c | 2 +- subsys/bluetooth/host/scan.c | 8 ++++---- subsys/bluetooth/host/scan.h | 2 ++ 5 files changed, 9 insertions(+), 16 deletions(-) diff --git a/include/zephyr/bluetooth/hci.h b/include/zephyr/bluetooth/hci.h index e321536d1e0..ecc005cf279 100644 --- a/include/zephyr/bluetooth/hci.h +++ b/include/zephyr/bluetooth/hci.h @@ -140,15 +140,6 @@ struct bt_le_ext_adv *bt_hci_adv_lookup_handle(uint8_t handle); */ int bt_hci_get_adv_sync_handle(const struct bt_le_per_adv_sync *sync, uint16_t *sync_handle); -/** @brief Get periodic advertising sync given an periodic advertising sync handle. - * - * @param handle The periodic sync set handle - * - * @retval The corresponding periodic advertising sync set object on success, - * NULL if it does not exist. - */ -struct bt_le_per_adv_sync *bt_hci_per_adv_sync_lookup_handle(uint16_t handle); - /** @brief Obtain the version string given a core version number. * * The core version of a controller can be obtained by issuing diff --git a/subsys/bluetooth/host/direction.c b/subsys/bluetooth/host/direction.c index 899ec2af06d..84ca24126c1 100644 --- a/subsys/bluetooth/host/direction.c +++ b/subsys/bluetooth/host/direction.c @@ -383,7 +383,7 @@ int hci_df_prepare_connectionless_iq_report(struct net_buf *buf, evt = net_buf_pull_mem(buf, sizeof(*evt)); - per_adv_sync = bt_hci_per_adv_sync_lookup_handle(sys_le16_to_cpu(evt->sync_handle)); + per_adv_sync = bt_hci_get_per_adv_sync(sys_le16_to_cpu(evt->sync_handle)); if (!per_adv_sync) { LOG_ERR("Unknown handle 0x%04X for iq samples report", @@ -431,7 +431,7 @@ int hci_df_vs_prepare_connectionless_iq_report(struct net_buf *buf, evt = net_buf_pull_mem(buf, sizeof(*evt)); - per_adv_sync = bt_hci_per_adv_sync_lookup_handle(sys_le16_to_cpu(evt->sync_handle)); + per_adv_sync = bt_hci_get_per_adv_sync(sys_le16_to_cpu(evt->sync_handle)); if (!per_adv_sync) { LOG_ERR("Unknown handle 0x%04X for iq samples report", diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 00b106d5ecb..d0e49e40910 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1698,7 +1698,7 @@ static void le_enh_conn_complete_v2(struct net_buf *buf) /* Created via PAwR sync, no adv set terminated event, needs separate handling */ struct bt_le_per_adv_sync *sync; - sync = bt_hci_per_adv_sync_lookup_handle(evt->sync_handle); + sync = bt_hci_get_per_adv_sync(evt->sync_handle); if (!sync) { LOG_ERR("Unknown sync handle %d", evt->sync_handle); diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index f8ec3a9e087..fc25ab696af 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -948,7 +948,7 @@ void bt_periodic_sync_disable(void) } } -struct bt_le_per_adv_sync *bt_hci_per_adv_sync_lookup_handle(uint16_t handle) +struct bt_le_per_adv_sync *bt_hci_get_per_adv_sync(uint16_t handle) { for (int i = 0; i < ARRAY_SIZE(per_adv_sync_pool); i++) { if (per_adv_sync_pool[i].handle == handle && @@ -1009,7 +1009,7 @@ static void bt_hci_le_per_adv_report_common(struct net_buf *buf) evt = net_buf_pull_mem(buf, sizeof(*evt)); - per_adv_sync = bt_hci_per_adv_sync_lookup_handle(sys_le16_to_cpu(evt->handle)); + per_adv_sync = bt_hci_get_per_adv_sync(sys_le16_to_cpu(evt->handle)); if (!per_adv_sync) { LOG_ERR("Unknown handle 0x%04X for periodic advertising report", @@ -1365,7 +1365,7 @@ void bt_hci_le_per_adv_sync_lost(struct net_buf *buf) (struct bt_hci_evt_le_per_adv_sync_lost *)buf->data; struct bt_le_per_adv_sync *per_adv_sync; - per_adv_sync = bt_hci_per_adv_sync_lookup_handle(sys_le16_to_cpu(evt->handle)); + per_adv_sync = bt_hci_get_per_adv_sync(sys_le16_to_cpu(evt->handle)); if (!per_adv_sync) { LOG_ERR("Unknown handle 0x%04Xfor periodic adv sync lost", @@ -1530,7 +1530,7 @@ void bt_hci_le_biginfo_adv_report(struct net_buf *buf) evt = net_buf_pull_mem(buf, sizeof(*evt)); - per_adv_sync = bt_hci_per_adv_sync_lookup_handle(sys_le16_to_cpu(evt->sync_handle)); + per_adv_sync = bt_hci_get_per_adv_sync(sys_le16_to_cpu(evt->sync_handle)); if (!per_adv_sync) { LOG_ERR("Unknown handle 0x%04X for periodic advertising report", diff --git a/subsys/bluetooth/host/scan.h b/subsys/bluetooth/host/scan.h index b30adfca3ba..6709fedc462 100644 --- a/subsys/bluetooth/host/scan.h +++ b/subsys/bluetooth/host/scan.h @@ -52,6 +52,8 @@ bool bt_le_scan_active_scanner_running(void); int bt_le_scan_set_enable(uint8_t enable); +struct bt_le_per_adv_sync *bt_hci_get_per_adv_sync(uint16_t handle); + void bt_periodic_sync_disable(void); /** From ccd47f7f359292cce30f211c9ac6ddbc1e9579a6 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 188/825] Revert "[nrf fromtree] Bluetooth: HCI: Expose bt_hci_adv_lookup_handle()" This reverts commit e6028fbf3813be93a8403f56a74d192c5289201e. --- include/zephyr/bluetooth/hci.h | 9 --------- subsys/bluetooth/host/adv.c | 10 +++++----- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/include/zephyr/bluetooth/hci.h b/include/zephyr/bluetooth/hci.h index ecc005cf279..21b6925ea33 100644 --- a/include/zephyr/bluetooth/hci.h +++ b/include/zephyr/bluetooth/hci.h @@ -122,15 +122,6 @@ int bt_hci_get_conn_handle(const struct bt_conn *conn, uint16_t *conn_handle); */ int bt_hci_get_adv_handle(const struct bt_le_ext_adv *adv, uint8_t *adv_handle); -/** @brief Get advertising set given an advertising handle - * - * @param handle The advertising handle - * - * @returns The corresponding advertising set on success, - * NULL if it does not exist. - */ -struct bt_le_ext_adv *bt_hci_adv_lookup_handle(uint8_t handle); - /** @brief Get periodic advertising sync handle. * * @param sync Periodic advertising sync set. diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 017ad497a42..0144cf52ffe 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -246,7 +246,7 @@ static void adv_delete(struct bt_le_ext_adv *adv) } #if defined(CONFIG_BT_BROADCASTER) -struct bt_le_ext_adv *bt_hci_adv_lookup_handle(uint8_t handle) +static struct bt_le_ext_adv *bt_adv_lookup_handle(uint8_t handle) { if (handle < ARRAY_SIZE(adv_pool) && atomic_test_bit(adv_pool[handle].flags, BT_ADV_CREATED)) { @@ -2020,7 +2020,7 @@ void bt_hci_le_per_adv_subevent_data_request(struct net_buf *buf) } evt = net_buf_pull_mem(buf, sizeof(struct bt_hci_evt_le_per_adv_subevent_data_request)); - adv = bt_hci_adv_lookup_handle(evt->adv_handle); + adv = bt_adv_lookup_handle(evt->adv_handle); if (!adv) { LOG_ERR("Unknown advertising handle %d", evt->adv_handle); @@ -2050,7 +2050,7 @@ void bt_hci_le_per_adv_response_report(struct net_buf *buf) } evt = net_buf_pull_mem(buf, sizeof(struct bt_hci_evt_le_per_adv_response_report)); - adv = bt_hci_adv_lookup_handle(evt->adv_handle); + adv = bt_adv_lookup_handle(evt->adv_handle); if (!adv) { LOG_ERR("Unknown advertising handle %d", evt->adv_handle); @@ -2150,7 +2150,7 @@ void bt_hci_le_adv_set_terminated(struct net_buf *buf) #endif evt = (void *)buf->data; - adv = bt_hci_adv_lookup_handle(evt->adv_handle); + adv = bt_adv_lookup_handle(evt->adv_handle); conn_handle = sys_le16_to_cpu(evt->conn_handle); LOG_DBG("status 0x%02x adv_handle %u conn_handle 0x%02x num %u", evt->status, @@ -2262,7 +2262,7 @@ void bt_hci_le_scan_req_received(struct net_buf *buf) struct bt_le_ext_adv *adv; evt = (void *)buf->data; - adv = bt_hci_adv_lookup_handle(evt->handle); + adv = bt_adv_lookup_handle(evt->handle); LOG_DBG("handle %u peer %s", evt->handle, bt_addr_le_str(&evt->addr)); From fcaa2d962f3bb097bfee3c53c94adea9fbd48ccd Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 189/825] Revert "[nrf fromtree] Bluetooth: Mark bt__err_to_str() APIs experimental" This reverts commit d86a806c2a53f827e890889ef2f07d7aa367904b. --- include/zephyr/bluetooth/att.h | 11 ----------- include/zephyr/bluetooth/conn.h | 11 ----------- include/zephyr/bluetooth/gatt.h | 2 -- include/zephyr/bluetooth/hci.h | 11 ----------- subsys/bluetooth/common/Kconfig | 8 -------- subsys/bluetooth/common/bt_str.c | 2 -- subsys/bluetooth/host/Kconfig | 17 ----------------- subsys/bluetooth/host/Kconfig.gatt | 8 -------- subsys/bluetooth/host/att.c | 3 +-- subsys/bluetooth/host/smp.c | 5 +---- subsys/bluetooth/host/smp.h | 9 --------- tests/bluetooth/gatt/prj.conf | 1 - tests/bluetooth/hci/prj.conf | 1 - tests/bluetooth/smp/prj.conf | 2 -- 14 files changed, 2 insertions(+), 89 deletions(-) diff --git a/include/zephyr/bluetooth/att.h b/include/zephyr/bluetooth/att.h index 349f8dd2fcd..4cf52de9818 100644 --- a/include/zephyr/bluetooth/att.h +++ b/include/zephyr/bluetooth/att.h @@ -114,19 +114,8 @@ extern "C" { * See also the defined BT_ATT_ERR_* macros. * * @return The string representation of the ATT error code. - * If @kconfig{CONFIG_BT_ATT_ERR_TO_STR} is not enabled, - * this just returns the empty string */ -#if defined(CONFIG_BT_ATT_ERR_TO_STR) const char *bt_att_err_to_str(uint8_t att_err); -#else -static inline const char *bt_att_err_to_str(uint8_t att_err) -{ - ARG_UNUSED(att_err); - - return ""; -} -#endif #if defined(CONFIG_BT_EATT) #if defined(CONFIG_BT_TESTING) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index 642aea95b6d..ff1aed7ace8 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -1289,19 +1289,8 @@ int bt_conn_cb_unregister(struct bt_conn_cb *cb); /** Converts a security error to string. * * @return The string representation of the security error code. - * If @kconfig{CONFIG_BT_SECURITY_ERR_TO_STR} is not enabled, - * this just returns the empty string */ -#if defined(CONFIG_BT_SECURITY_ERR_TO_STR) const char *bt_security_err_to_str(enum bt_security_err err); -#else -static inline const char *bt_security_err_to_str(enum bt_security_err err) -{ - ARG_UNUSED(err); - - return ""; -} -#endif /** @brief Enable/disable bonding. * diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index d4ad46debe5..6ee226f31cf 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -413,8 +413,6 @@ struct bt_gatt_cpf { * See also the defined BT_ATT_ERR_* macros. * * @return The string representation of the GATT error code. - * If @kconfig{CONFIG_BT_ATT_ERR_TO_STR} is not enabled, - * this just returns the empty string. */ static inline const char *bt_gatt_err_to_str(int gatt_err) { diff --git a/include/zephyr/bluetooth/hci.h b/include/zephyr/bluetooth/hci.h index 21b6925ea33..7dfcb227527 100644 --- a/include/zephyr/bluetooth/hci.h +++ b/include/zephyr/bluetooth/hci.h @@ -31,19 +31,8 @@ extern "C" { * See also the defined BT_HCI_ERR_* macros. * * @return The string representation of the HCI error code. - * If @kconfig{CONFIG_BT_HCI_ERR_TO_STR} is not enabled, - * this just returns the empty string */ -#if defined(CONFIG_BT_HCI_ERR_TO_STR) const char *bt_hci_err_to_str(uint8_t hci_err); -#else -static inline const char *bt_hci_err_to_str(uint8_t hci_err) -{ - ARG_UNUSED(hci_err); - - return ""; -} -#endif /** Allocate a HCI command buffer. * diff --git a/subsys/bluetooth/common/Kconfig b/subsys/bluetooth/common/Kconfig index 36316b4061a..ce64b4d70c8 100644 --- a/subsys/bluetooth/common/Kconfig +++ b/subsys/bluetooth/common/Kconfig @@ -253,14 +253,6 @@ config BT_ASSERT_PANIC endif # BT_ASSERT -config BT_HCI_ERR_TO_STR - bool "Print HCI error codes as strings [EXPERIMENTAL]" - select EXPERIMENTAL - help - This configuration enables printing of HCI error - codes represented as strings. - See bt_hci_err_to_str() for more details. - config BT_MONITOR bool select LOG_OUTPUT diff --git a/subsys/bluetooth/common/bt_str.c b/subsys/bluetooth/common/bt_str.c index 7e8e8d9f2e2..08247931989 100644 --- a/subsys/bluetooth/common/bt_str.c +++ b/subsys/bluetooth/common/bt_str.c @@ -62,7 +62,6 @@ const char *bt_uuid_str(const struct bt_uuid *uuid) return str; } -#if defined(CONFIG_BT_HCI_ERR_TO_STR) const char *bt_hci_err_to_str(uint8_t hci_err) { #define HCI_ERR(err) [err] = #err @@ -147,4 +146,3 @@ const char *bt_hci_err_to_str(uint8_t hci_err) #undef HCI_ERR } -#endif /* CONFIG_BT_HCI_ERR_TO_STR */ diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 51dff587040..f9bbac130cc 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -362,23 +362,6 @@ config BT_SMP (SMP), making it possible to pair devices over LE. if BT_SMP - -config BT_SECURITY_ERR_TO_STR - bool "Print security error codes as strings [EXPERIMENTAL]" - select EXPERIMENTAL - help - This configuration enables printing of security error - codes represented as strings. - See bt_security_err_to_str() for more details. - -config BT_SMP_ERR_TO_STR - bool "Print SMP error codes as strings [EXPERIMENTAL]" - select EXPERIMENTAL - help - This configuration enables printing of SMP error - codes represented as strings. - See bt_smp_err_to_str() for more details. - config BT_PASSKEY_KEYPRESS bool "Passkey Keypress Notification support [EXPERIMENTAL]" select EXPERIMENTAL diff --git a/subsys/bluetooth/host/Kconfig.gatt b/subsys/bluetooth/host/Kconfig.gatt index d06f3741fcd..ac1a751fa0b 100644 --- a/subsys/bluetooth/host/Kconfig.gatt +++ b/subsys/bluetooth/host/Kconfig.gatt @@ -5,14 +5,6 @@ menu "ATT and GATT Options" -config BT_ATT_ERR_TO_STR - bool "Print ATT error codes as strings [EXPERIMENTAL]" - select EXPERIMENTAL - help - This configuration enables printing of ATT error - codes represented as strings. - See bt_att_err_to_str() for more details. - config BT_ATT_TX_COUNT int "Number of ATT buffers" default BT_BUF_ACL_TX_COUNT diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index 334e8edaa59..a5ef410466f 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -185,7 +185,7 @@ static struct bt_att_tx_meta_data tx_meta_data_storage[CONFIG_BT_ATT_TX_COUNT]; struct bt_att_tx_meta_data *bt_att_get_tx_meta_data(const struct net_buf *buf); static void att_on_sent_cb(struct bt_att_tx_meta_data *meta); -#if defined(CONFIG_BT_ATT_ERR_TO_STR) + const char *bt_att_err_to_str(uint8_t att_err) { /* To mapping tables are used to avoid a big gap with NULL-entries. */ @@ -239,7 +239,6 @@ const char *bt_att_err_to_str(uint8_t att_err) #undef ATT_ERR #undef ATT_ERR_SECOND } -#endif /* CONFIG_BT_ATT_ERR_TO_STR */ static void att_tx_destroy(struct net_buf *buf) { diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 39eafaee321..4095c6087ee 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -475,7 +475,6 @@ static enum bt_security_err security_err_get(uint8_t smp_err) } } -#if defined(CONFIG_BT_SECURITY_ERR_TO_STR) const char *bt_security_err_to_str(enum bt_security_err err) { #define SEC_ERR(err) [err] = #err @@ -501,7 +500,7 @@ const char *bt_security_err_to_str(enum bt_security_err err) #undef SEC_ERR } -#endif /* CONFIG_BT_SECURITY_ERR_TO_STR */ + static uint8_t smp_err_get(enum bt_security_err auth_err) { @@ -528,7 +527,6 @@ static uint8_t smp_err_get(enum bt_security_err auth_err) } } -#if defined(CONFIG_BT_SMP_ERR_TO_STR) const char *bt_smp_err_to_str(uint8_t smp_err) { #define SMP_ERR(err) [err] = #err @@ -560,7 +558,6 @@ const char *bt_smp_err_to_str(uint8_t smp_err) #undef SMP_ERR } -#endif /* CONFIG_BT_SMP_ERR_TO_STR */ static struct net_buf *smp_create_pdu(struct bt_smp *smp, uint8_t op, size_t len) { diff --git a/subsys/bluetooth/host/smp.h b/subsys/bluetooth/host/smp.h index 51969aaadfb..3ec68d3b670 100644 --- a/subsys/bluetooth/host/smp.h +++ b/subsys/bluetooth/host/smp.h @@ -192,13 +192,4 @@ int bt_smp_irk_get(uint8_t *ir, uint8_t *irk); * * @return The string representation of the SMP error code. */ -#if defined(CONFIG_BT_SMP_ERR_TO_STR) const char *bt_smp_err_to_str(uint8_t smp_err); -#else -static inline const char *bt_smp_err_to_str(uint8_t smp_err) -{ - ARG_UNUSED(smp_err); - - return ""; -} -#endif diff --git a/tests/bluetooth/gatt/prj.conf b/tests/bluetooth/gatt/prj.conf index 88706f76035..f705142d552 100644 --- a/tests/bluetooth/gatt/prj.conf +++ b/tests/bluetooth/gatt/prj.conf @@ -8,4 +8,3 @@ CONFIG_BT_H4=n CONFIG_LOG=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_GATT_DYNAMIC_DB=y -CONFIG_BT_ATT_ERR_TO_STR=y diff --git a/tests/bluetooth/hci/prj.conf b/tests/bluetooth/hci/prj.conf index dc7e7ba5a4f..1f86a43c208 100644 --- a/tests/bluetooth/hci/prj.conf +++ b/tests/bluetooth/hci/prj.conf @@ -4,4 +4,3 @@ CONFIG_ZTEST=y CONFIG_BT=y CONFIG_BT_CTLR=n CONFIG_BT_H4=n -CONFIG_BT_HCI_ERR_TO_STR=y diff --git a/tests/bluetooth/smp/prj.conf b/tests/bluetooth/smp/prj.conf index 0b6afd9a57b..a5d4251d5ff 100644 --- a/tests/bluetooth/smp/prj.conf +++ b/tests/bluetooth/smp/prj.conf @@ -8,5 +8,3 @@ CONFIG_BT_H4=n CONFIG_LOG=y CONFIG_BT_PERIPHERAL=y -CONFIG_BT_SMP_ERR_TO_STR=y -CONFIG_BT_SECURITY_ERR_TO_STR=y From fb32cb9ec482eb89319c2f3734ffcd21b772ca4a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 190/825] Revert "[nrf fromlist] testsuite: coverage: allow disabled multithreading" This reverts commit 631b9a25d5ab2951bacbdf33576a529c7aeb87a2. --- subsys/testsuite/coverage/coverage.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/subsys/testsuite/coverage/coverage.c b/subsys/testsuite/coverage/coverage.c index 43f014e6e4f..b1581cc4588 100644 --- a/subsys/testsuite/coverage/coverage.c +++ b/subsys/testsuite/coverage/coverage.c @@ -262,9 +262,7 @@ void gcov_coverage_dump(void) struct gcov_info *gcov_list = gcov_info_head; if (!k_is_in_isr()) { -#ifdef CONFIG_MULTITHREADING k_sched_lock(); -#endif } printk("\nGCOV_COVERAGE_DUMP_START"); while (gcov_list) { @@ -295,9 +293,7 @@ void gcov_coverage_dump(void) coverage_dump_end: printk("\nGCOV_COVERAGE_DUMP_END\n"); if (!k_is_in_isr()) { -#ifdef CONFIG_MULTITHREADING k_sched_unlock(); -#endif } return; } From 8f1c12150fbf20751ef8ca352fa6de84f0386447 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 191/825] Revert "[nrf noup] bluetooth: conn: Allow for an extra ref in bt_l2cap_send_pdu" This reverts commit e84675a823bf19f42d30ff8d63e435ada6dd37e4. --- subsys/bluetooth/host/conn.c | 8 +------- subsys/bluetooth/host/l2cap.c | 8 ++------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 2e346b7dcc2..541854e01fe 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -654,13 +654,7 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, uint16_t frag_len = MIN(conn_mtu(conn), len); - if (buf->ref > 1 + (cb ? 1 : 0)) { - /* 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(false); - } + __ASSERT_NO_MSG(buf->ref == 1); if (buf->len > frag_len) { LOG_DBG("keep %p around", buf); diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index eff69ac0672..9e20037f52f 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -699,17 +699,13 @@ static void cancel_data_ready(struct bt_l2cap_le_chan *le_chan) int bt_l2cap_send_pdu(struct bt_l2cap_le_chan *le_chan, struct net_buf *pdu, bt_conn_tx_cb_t cb, void *user_data) { - /* 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 d61ca985cf3b209b3478051dfbe1f5e484bb35b5 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:02:59 +0200 Subject: [PATCH 192/825] Revert "[nrf fromlist] Bluetooth: Host: Fix compiling PAwR Sync without PAST RX" This reverts commit ee94b905473f068a206be2efe79e72d033a71972. --- subsys/bluetooth/host/hci_core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index d0e49e40910..46dea5ee542 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -2802,10 +2802,8 @@ static const struct event_handler meta_events[] = { #if defined(CONFIG_BT_PER_ADV_SYNC_RSP) EVENT_HANDLER(BT_HCI_EVT_LE_PER_ADVERTISING_REPORT_V2, bt_hci_le_per_adv_report_v2, sizeof(struct bt_hci_evt_le_per_advertising_report_v2)), -#if defined(CONFIG_BT_PER_ADV_SYNC_TRANSFER_RECEIVER) EVENT_HANDLER(BT_HCI_EVT_LE_PAST_RECEIVED_V2, bt_hci_le_past_received_v2, sizeof(struct bt_hci_evt_le_past_received_v2)), -#endif /* CONFIG_BT_PER_ADV_SYNC_TRANSFER_RECEIVER */ EVENT_HANDLER(BT_HCI_EVT_LE_PER_ADV_SYNC_ESTABLISHED_V2, bt_hci_le_per_adv_sync_established_v2, sizeof(struct bt_hci_evt_le_per_adv_sync_established_v2)), From b049f25f301257741a8dd607e9df3729e8fafc77 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 193/825] Revert "[nrf noup] bluetooth: att: Allow ATT sent callback after data TX is done" This reverts commit 43cced8e228f12d75a809d5daf6aecee18575071. --- 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 ac1a751fa0b..310442423b9 100644 --- a/subsys/bluetooth/host/Kconfig.gatt +++ b/subsys/bluetooth/host/Kconfig.gatt @@ -30,23 +30,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 a5ef410466f..f883e2b12de 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -315,13 +315,6 @@ static void att_sent(void *user_data) bt_att_sent(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. @@ -415,15 +408,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 102cc359e92cf7bac6f05bd39c7d260ed8366974 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 194/825] Revert "[nrf fromlist] Bluetooth: Host: Fix bt_disable() for IPC giving HCI Reset timeout" This reverts commit ff26b0a714146262db8c0d8947632e1eb747ff91. --- subsys/bluetooth/host/hci_core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 46dea5ee542..a2f87ad7311 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -4344,6 +4344,11 @@ int bt_disable(void) disconnected_handles_reset(); #endif /* CONFIG_BT_CONN */ +#if defined(CONFIG_BT_RECV_WORKQ_BT) + /* Abort RX thread */ + k_thread_abort(&bt_workq.thread); +#endif + #if DT_HAS_CHOSEN(zephyr_bt_hci) err = bt_hci_close(bt_dev.hci); if (err == -ENOSYS) { @@ -4363,11 +4368,6 @@ int bt_disable(void) return err; } -#if defined(CONFIG_BT_RECV_WORKQ_BT) - /* Abort RX thread */ - k_thread_abort(&bt_workq.thread); -#endif - /* Some functions rely on checking this bitfield */ memset(bt_dev.supported_commands, 0x00, sizeof(bt_dev.supported_commands)); From 40abd7c009e84e6c0a7a975b07c73a17f6db7f08 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 195/825] Revert "[nrf fromtree] Bluetooth: host: Use correct user_data size for hci_rx_pool" This reverts commit 08965062c21dfae0d6cfed357fccda1c5383f09e. --- subsys/bluetooth/host/buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/buf.c b/subsys/bluetooth/host/buf.c index 5706ea29a83..a1d107cf654 100644 --- a/subsys/bluetooth/host/buf.c +++ b/subsys/bluetooth/host/buf.c @@ -59,7 +59,7 @@ NET_BUF_POOL_FIXED_DEFINE(evt_pool, CONFIG_BT_BUF_EVT_RX_COUNT, NULL); #else NET_BUF_POOL_FIXED_DEFINE(hci_rx_pool, BT_BUF_RX_COUNT, - BT_BUF_RX_SIZE, sizeof(struct acl_data), + BT_BUF_RX_SIZE, sizeof(struct bt_buf_data), NULL); #endif /* CONFIG_BT_HCI_ACL_FLOW_CONTROL */ From 860d05530869a02b340f225e91fb4162496b9b25 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 196/825] Revert "[nrf fromtree] Bluetooth: Host: Fix recv_enabled field for PAST" This reverts commit bcb5d0322d9ba2c39cf8484c98a54b92e146f451. --- subsys/bluetooth/host/hci_core.c | 4 +- subsys/bluetooth/host/scan.c | 82 ++++---------------------------- 2 files changed, 11 insertions(+), 75 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index a2f87ad7311..038e958664f 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -2746,10 +2746,10 @@ static const struct event_handler meta_events[] = { sizeof(struct bt_hci_evt_le_per_advertising_report)), EVENT_HANDLER(BT_HCI_EVT_LE_PER_ADV_SYNC_LOST, bt_hci_le_per_adv_sync_lost, sizeof(struct bt_hci_evt_le_per_adv_sync_lost)), -#if defined(CONFIG_BT_PER_ADV_SYNC_TRANSFER_RECEIVER) +#if defined(CONFIG_BT_CONN) EVENT_HANDLER(BT_HCI_EVT_LE_PAST_RECEIVED, bt_hci_le_past_received, sizeof(struct bt_hci_evt_le_past_received)), -#endif /* CONFIG_BT_PER_ADV_SYNC_TRANSFER_RECEIVER */ +#endif /* CONFIG_BT_CONN */ #endif /* defined(CONFIG_BT_PER_ADV_SYNC) */ #endif /* defined(CONFIG_BT_EXT_ADV) */ #if defined(CONFIG_BT_ISO_UNICAST) diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index fc25ab696af..ec678a766a5 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -1377,22 +1377,7 @@ void bt_hci_le_per_adv_sync_lost(struct net_buf *buf) per_adv_sync_terminated(per_adv_sync, BT_HCI_ERR_UNSPECIFIED); } -#if defined(CONFIG_BT_PER_ADV_SYNC_TRANSFER_RECEIVER) -static uint8_t conn_past_modes[CONFIG_BT_MAX_CONN]; -static uint8_t default_past_mode; - -static void past_disconnected_cb(struct bt_conn *conn, uint8_t reason) -{ - /* The core spec does not explicit state that the mode of a connection handle is cleared on - * disconnect, but let's assume it is. - */ - conn_past_modes[bt_conn_index(conn)] = BT_HCI_LE_PAST_MODE_NO_SYNC; -} - -BT_CONN_CB_DEFINE(past_conn_callbacks) = { - .disconnected = past_disconnected_cb, -}; - +#if defined(CONFIG_BT_CONN) static void bt_hci_le_past_received_common(struct net_buf *buf) { #if defined(CONFIG_BT_PER_ADV_SYNC_RSP) @@ -1460,18 +1445,7 @@ static void bt_hci_le_past_received_common(struct net_buf *buf) sync_info.addr = &per_adv_sync->addr; sync_info.sid = per_adv_sync->sid; sync_info.service_data = sys_le16_to_cpu(evt->service_data); - - const uint8_t mode = conn_past_modes[bt_conn_index(sync_info.conn)]; - - if (mode == BT_HCI_LE_PAST_MODE_NO_SYNC) { - /* Use the default parameter mode as the conn specific mode is not set */ - sync_info.recv_enabled = - default_past_mode == BT_HCI_LE_PAST_MODE_SYNC || - default_past_mode == BT_HCI_LE_PAST_MODE_SYNC_FILTER_DUPLICATES; - } else { - sync_info.recv_enabled = mode == BT_HCI_LE_PAST_MODE_SYNC || - mode == BT_HCI_LE_PAST_MODE_SYNC_FILTER_DUPLICATES; - } + sync_info.recv_enabled = true; #if defined(CONFIG_BT_PER_ADV_SYNC_RSP) sync_info.num_subevents = per_adv_sync->num_subevents; @@ -1506,7 +1480,7 @@ void bt_hci_le_past_received_v2(struct net_buf *buf) bt_hci_le_past_received_common(buf); } #endif /* CONFIG_BT_PER_ADV_SYNC_RSP */ -#endif /* CONFIG_BT_PER_ADV_SYNC_TRANSFER_RECEIVER */ +#endif /* CONFIG_BT_CONN */ #if defined(CONFIG_BT_PER_ADV_SYNC_RSP) void bt_hci_le_per_adv_sync_established_v2(struct net_buf *buf) @@ -2201,7 +2175,6 @@ int bt_le_per_adv_sync_transfer_subscribe( { uint8_t cte_type = 0; uint8_t mode = BT_HCI_LE_PAST_MODE_SYNC; - int err; if (!BT_FEAT_LE_EXT_PER_ADV(bt_dev.le.features)) { return -ENOTSUP; @@ -2236,35 +2209,14 @@ int bt_le_per_adv_sync_transfer_subscribe( } if (conn) { - const uint8_t conn_idx = bt_conn_index(conn); - const uint8_t old_mode = conn_past_modes[conn_idx]; - - conn_past_modes[conn_idx] = mode; - - err = past_param_set(conn, mode, param->skip, param->timeout, cte_type); - if (err != 0) { - /* Restore old mode */ - conn_past_modes[conn_idx] = old_mode; - } + return past_param_set(conn, mode, param->skip, param->timeout, cte_type); } else { - const uint8_t old_mode = default_past_mode; - - default_past_mode = mode; - - err = default_past_param_set(mode, param->skip, param->timeout, cte_type); - if (err != 0) { - /* Restore old mode */ - default_past_mode = old_mode; - } + return default_past_param_set(mode, param->skip, param->timeout, cte_type); } - - return err; } int bt_le_per_adv_sync_transfer_unsubscribe(const struct bt_conn *conn) { - int err; - if (!BT_FEAT_LE_EXT_PER_ADV(bt_dev.le.features)) { return -ENOTSUP; } else if (!BT_FEAT_LE_PAST_RECV(bt_dev.le.features)) { @@ -2272,28 +2224,12 @@ int bt_le_per_adv_sync_transfer_unsubscribe(const struct bt_conn *conn) } if (conn) { - const uint8_t conn_idx = bt_conn_index(conn); - const uint8_t old_mode = conn_past_modes[conn_idx]; - - conn_past_modes[conn_idx] = BT_HCI_LE_PAST_MODE_NO_SYNC; - - err = past_param_set(conn, BT_HCI_LE_PAST_MODE_NO_SYNC, 0, 0x0a, 0); - if (err != 0) { - /* Restore old mode */ - conn_past_modes[conn_idx] = old_mode; - } + return past_param_set(conn, BT_HCI_LE_PAST_MODE_NO_SYNC, 0, + 0x0a, 0); } else { - const uint8_t old_mode = default_past_mode; - - default_past_mode = BT_HCI_LE_PAST_MODE_NO_SYNC; - err = default_past_param_set(BT_HCI_LE_PAST_MODE_NO_SYNC, 0, 0x0a, 0); - if (err != 0) { - /* Restore old mode */ - default_past_mode = old_mode; - } + return default_past_param_set(BT_HCI_LE_PAST_MODE_NO_SYNC, 0, + 0x0a, 0); } - - return err; } #endif /* CONFIG_BT_PER_ADV_SYNC_TRANSFER_RECEIVER */ From 1ee7ebb29c5b71a2aab664728402ee5c4af6b677 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 197/825] Revert "[nrf fromtree] Bluetooth: Host: Remove conn param update checks" This reverts commit 47dec5161e596b5ac4f78fa58e1ab22e8b6afb6f. --- subsys/bluetooth/host/conn.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 541854e01fe..bd74df154b9 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -3017,6 +3017,15 @@ int bt_conn_le_param_update(struct bt_conn *conn, LOG_DBG("conn %p features 0x%02x params (%d-%d %d %d)", conn, conn->le.features[0], param->interval_min, param->interval_max, param->latency, param->timeout); + /* Check if there's a need to update conn params */ + if (conn->le.interval >= param->interval_min && + conn->le.interval <= param->interval_max && + conn->le.latency == param->latency && + conn->le.timeout == param->timeout) { + atomic_clear_bit(conn->flags, BT_CONN_PERIPHERAL_PARAM_SET); + return -EALREADY; + } + if (IS_ENABLED(CONFIG_BT_CENTRAL) && conn->role == BT_CONN_ROLE_CENTRAL) { return send_conn_le_param_update(conn, param); From 5418f4830d897fea06d93667bc0448a693a9b710 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 198/825] Revert "[nrf fromtree] bluetooth: `bt_le_ext_adv_start_param` is const" This reverts commit 6fca92e2c2d9bc98ffa3fd5e30838e581e72cd36. --- include/zephyr/bluetooth/bluetooth.h | 2 +- subsys/bluetooth/host/adv.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/zephyr/bluetooth/bluetooth.h b/include/zephyr/bluetooth/bluetooth.h index 31b30861203..ddeb7a8c32b 100644 --- a/include/zephyr/bluetooth/bluetooth.h +++ b/include/zephyr/bluetooth/bluetooth.h @@ -1241,7 +1241,7 @@ struct bt_le_ext_adv_start_param { * @param param Advertise start parameters. */ int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, - const struct bt_le_ext_adv_start_param *param); + struct bt_le_ext_adv_start_param *param); /** * @brief Stop advertising with the given advertising set diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 0144cf52ffe..a6d62bd6db9 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -1613,7 +1613,7 @@ int bt_le_ext_adv_update_param(struct bt_le_ext_adv *adv, } int bt_le_ext_adv_start(struct bt_le_ext_adv *adv, - const struct bt_le_ext_adv_start_param *param) + struct bt_le_ext_adv_start_param *param) { struct bt_conn *conn = NULL; int err; From 2eefe0a388fc7883f5fcd01ab432a1da07ea3768 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 199/825] Revert "[nrf fromtree] Bluetooth: Fix CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY build warnings" This reverts commit 5b04077b8f006991015a896b88e5a251dab02e93. --- subsys/bluetooth/host/smp.c | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 4095c6087ee..4b35b9d2da5 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -652,7 +652,6 @@ static bool update_keys_check(struct bt_smp *smp, struct bt_keys *keys) return true; } -#ifndef CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY static bool update_debug_keys_check(struct bt_smp *smp) { struct bt_conn *conn = smp->chan.chan.conn; @@ -672,7 +671,6 @@ static bool update_debug_keys_check(struct bt_smp *smp) return false; } -#endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY */ #if defined(CONFIG_BT_PRIVACY) || defined(CONFIG_BT_SIGNING) || \ !defined(CONFIG_BT_SMP_SC_PAIR_ONLY) @@ -3174,6 +3172,7 @@ static int smp_send_pairing_req(struct bt_conn *conn) static uint8_t smp_pairing_rsp(struct bt_smp *smp, struct net_buf *buf) { struct bt_conn *conn = smp->chan.chan.conn; + const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); struct bt_smp_pairing *rsp = (void *)buf->data; struct bt_smp_pairing *req = (struct bt_smp_pairing *)&smp->preq[1]; uint8_t err; @@ -3228,17 +3227,7 @@ static uint8_t smp_pairing_rsp(struct bt_smp *smp, struct net_buf *buf) return err; } - /* the OR operation evaluated by "if" statement bellow seems redundant - * when CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY is enabled, because in - * that case the SMP_FLAG_SC will always be set to false. But it's - * needed in order to inform the compiler that the inside of the "if" - * is the return point for CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY enabled - * builds. This avoids compiler warnings regarding the code after the - * "if" statement, that would happen for builds with - * CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY enabled - */ - if (IS_ENABLED(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) || - !atomic_test_bit(smp->flags, SMP_FLAG_SC)) { + if (!atomic_test_bit(smp->flags, SMP_FLAG_SC)) { #if defined(CONFIG_BT_SMP_SC_PAIR_ONLY) return BT_SMP_ERR_AUTH_REQUIREMENTS; #else @@ -3253,8 +3242,6 @@ static uint8_t smp_pairing_rsp(struct bt_smp *smp, struct net_buf *buf) #endif /* CONFIG_BT_SMP_SC_PAIR_ONLY */ } - const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); - smp->local_dist &= SEND_KEYS_SC; smp->remote_dist &= RECV_KEYS_SC; @@ -3609,7 +3596,6 @@ static uint8_t sc_smp_check_confirm(struct bt_smp *smp) return 0; } -#ifndef CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY static bool le_sc_oob_data_req_check(struct bt_smp *smp) { struct bt_smp_pairing *req = (struct bt_smp_pairing *)&smp->preq[1]; @@ -3654,7 +3640,6 @@ static void le_sc_oob_config_set(struct bt_smp *smp, info->lesc.oob_config = oob_config; } -#endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY */ static uint8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf) { @@ -4154,7 +4139,6 @@ static uint8_t smp_security_request(struct bt_smp *smp, struct net_buf *buf) } #endif /* CONFIG_BT_CENTRAL */ -#ifndef CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY static uint8_t generate_dhkey(struct bt_smp *smp) { if (IS_ENABLED(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY)) { @@ -4196,7 +4180,6 @@ static uint8_t display_passkey(struct bt_smp *smp) return 0; } -#endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY */ #if defined(CONFIG_BT_PERIPHERAL) static uint8_t smp_public_key_periph(struct bt_smp *smp) @@ -4255,12 +4238,6 @@ static uint8_t smp_public_key_periph(struct bt_smp *smp) } #endif /* CONFIG_BT_PERIPHERAL */ -#ifdef CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY -static uint8_t smp_public_key(struct bt_smp *smp, struct net_buf *buf) -{ - return BT_SMP_ERR_AUTH_REQUIREMENTS; -} -#else static uint8_t smp_public_key(struct bt_smp *smp, struct net_buf *buf) { const struct bt_conn_auth_cb *smp_auth_cb = latch_auth_cb(smp); @@ -4373,7 +4350,6 @@ static uint8_t smp_public_key(struct bt_smp *smp, struct net_buf *buf) return 0; } -#endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY */ static uint8_t smp_dhkey_check(struct bt_smp *smp, struct net_buf *buf) { From 10e454683c475b67784939c8652879d14358c9f1 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 200/825] Revert "[nrf fromtree] Bluetooth: Host: Add missing buffer length check" This reverts commit 20b320c1a648a4f34d161e79a0e8bd9e2ca767bb. --- subsys/bluetooth/host/scan.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index ec678a766a5..4ed008f2be4 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -784,24 +784,6 @@ void bt_hci_le_adv_ext_report(struct net_buf *buf) is_report_complete = data_status == BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS_COMPLETE; more_to_come = data_status == BT_HCI_LE_ADV_EVT_TYPE_DATA_STATUS_PARTIAL; - if (evt->length > buf->len) { - LOG_WRN("Adv report corrupted (wants %u out of %u)", evt->length, buf->len); - - net_buf_reset(buf); - - if (evt_type & BT_HCI_LE_ADV_EVT_TYPE_LEGACY) { - return; - } - - /* Start discarding irrespective of the `more_to_come` flag. We - * assume we may have lost a partial adv report in the truncated - * data. - */ - reassembling_advertiser.state = FRAG_ADV_DISCARDING; - - return; - } - if (evt_type & BT_HCI_LE_ADV_EVT_TYPE_LEGACY) { /* Legacy advertising reports are complete. * Create event immediately. @@ -863,6 +845,19 @@ void bt_hci_le_adv_ext_report(struct net_buf *buf) reassembling_advertiser.state = FRAG_ADV_DISCARDING; } + if (evt->length > buf->len) { + LOG_WRN("Adv report corrupted (wants %u out of %u)", evt->length, buf->len); + + /* Start discarding irrespective of the `more_to_come` flag. We + * assume we may have lost a partial adv report in the truncated + * data. + */ + reassembling_advertiser.state = FRAG_ADV_DISCARDING; + net_buf_reset(buf); + + return; + } + if (reassembling_advertiser.state == FRAG_ADV_DISCARDING) { if (!more_to_come) { /* We do no longer need to keep track of this advertiser as From 9027ede29b5997c28c1ad899079c48c15e8eeba8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 201/825] Revert "[nrf fromtree] Bluetooth: Host: Fix HCI command timeout usage" This reverts commit f15d6f5d85d5f1837fa59e45ba8c83d3e805d593. --- subsys/bluetooth/host/hci_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 038e958664f..d760a57762e 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -4649,7 +4649,7 @@ int bt_configure_data_path(uint8_t dir, uint8_t id, uint8_t vs_config_len, static bool process_pending_cmd(k_timeout_t timeout) { if (!k_fifo_is_empty(&bt_dev.cmd_tx_queue)) { - if (k_sem_take(&bt_dev.ncmd_sem, timeout) == 0) { + if (k_sem_take(&bt_dev.ncmd_sem, K_NO_WAIT) == 0) { hci_core_send_cmd(); return true; } From b0ec727a5edcabed008d01f9dd70ffa8e801d14a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 202/825] Revert "[nrf fromtree] samples: bluetooth: Fixes `bt_hci_cmd_send_sync` API usage" This reverts commit abb929c9ae44c1e87d08faa375bb475d4edf6c3a. --- samples/bluetooth/hci_pwr_ctrl/src/main.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/samples/bluetooth/hci_pwr_ctrl/src/main.c b/samples/bluetooth/hci_pwr_ctrl/src/main.c index 9eb936039f9..74318525753 100644 --- a/samples/bluetooth/hci_pwr_ctrl/src/main.c +++ b/samples/bluetooth/hci_pwr_ctrl/src/main.c @@ -65,7 +65,9 @@ static void read_conn_rssi(uint16_t handle, int8_t *rssi) err = bt_hci_cmd_send_sync(BT_HCI_OP_READ_RSSI, buf, &rsp); if (err) { - printk("Read RSSI err: %d\n", err); + uint8_t reason = rsp ? + ((struct bt_hci_rp_read_rssi *)rsp->data)->status : 0; + printk("Read RSSI err: %d reason 0x%02x\n", err, reason); return; } @@ -98,7 +100,10 @@ static void set_tx_power(uint8_t handle_type, uint16_t handle, int8_t tx_pwr_lvl err = bt_hci_cmd_send_sync(BT_HCI_OP_VS_WRITE_TX_POWER_LEVEL, buf, &rsp); if (err) { - printk("Set Tx power err: %d\n", err); + uint8_t reason = rsp ? + ((struct bt_hci_rp_vs_write_tx_power_level *) + rsp->data)->status : 0; + printk("Set Tx power err: %d reason 0x%02x\n", err, reason); return; } @@ -130,7 +135,10 @@ static void get_tx_power(uint8_t handle_type, uint16_t handle, int8_t *tx_pwr_lv err = bt_hci_cmd_send_sync(BT_HCI_OP_VS_READ_TX_POWER_LEVEL, buf, &rsp); if (err) { - printk("Read Tx power err: %d\n", err); + uint8_t reason = rsp ? + ((struct bt_hci_rp_vs_read_tx_power_level *) + rsp->data)->status : 0; + printk("Read Tx power err: %d reason 0x%02x\n", err, reason); return; } From e624f6c2f8915b91913a16f03ea7f21b0a6d3929 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 203/825] Revert "[nrf fromtree] drivers: bluetooth: Remove unused rsp params" This reverts commit 773c20de42da1bf098a5690c9b1cdacaba7fa05d. --- drivers/bluetooth/hci/ipm_stm32wb.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/bluetooth/hci/ipm_stm32wb.c b/drivers/bluetooth/hci/ipm_stm32wb.c index 7e672636b8f..df83ee36d54 100644 --- a/drivers/bluetooth/hci/ipm_stm32wb.c +++ b/drivers/bluetooth/hci/ipm_stm32wb.c @@ -428,7 +428,7 @@ static int bt_ipm_set_addr(void) { bt_addr_t *uid_addr; struct aci_set_ble_addr *param; - struct net_buf *buf; + struct net_buf *buf, *rsp; int err; uid_addr = bt_get_ble_addr(); @@ -452,18 +452,18 @@ static int bt_ipm_set_addr(void) param->value[4] = uid_addr->val[4]; param->value[5] = uid_addr->val[5]; - err = bt_hci_cmd_send_sync(ACI_HAL_WRITE_CONFIG_DATA, buf, NULL); + err = bt_hci_cmd_send_sync(ACI_HAL_WRITE_CONFIG_DATA, buf, &rsp); if (err) { return err; } - + net_buf_unref(rsp); return 0; } static int bt_ipm_ble_init(void) { struct aci_set_tx_power *param; - struct net_buf *buf; + struct net_buf *buf, *rsp; int err; err = bt_ipm_set_addr(); @@ -480,10 +480,11 @@ static int bt_ipm_ble_init(void) param->value[0] = 0x18; param->value[1] = 0x01; - err = bt_hci_cmd_send_sync(ACI_WRITE_SET_TX_POWER_LEVEL, buf, NULL); + err = bt_hci_cmd_send_sync(ACI_WRITE_SET_TX_POWER_LEVEL, buf, &rsp); if (err) { return err; } + net_buf_unref(rsp); return 0; } @@ -584,12 +585,14 @@ static int bt_ipm_close(const struct device *dev) { struct hci_data *hci = dev->data; int err; + struct net_buf *rsp; - err = bt_hci_cmd_send_sync(ACI_HAL_STACK_RESET, NULL, NULL); + err = bt_hci_cmd_send_sync(ACI_HAL_STACK_RESET, NULL, &rsp); if (err) { LOG_ERR("IPM Channel Close Issue"); return err; } + net_buf_unref(rsp); /* Wait till C2DS set */ while (LL_PWR_IsActiveFlag_C2DS() == 0) { From a296cddf391a1d401f0f63852055587c78459ed8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 204/825] Revert "[nrf fromtree] Bluetooth: Host: Enforce correct pool in `bt_hci_cmd_send_sync`" This reverts commit 4d122405ab1798cb7a19e7f3fb03823c0f203e43. --- subsys/bluetooth/host/hci_core.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index d760a57762e..3c03f80a1e6 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -356,12 +355,6 @@ int bt_hci_cmd_send_sync(uint16_t opcode, struct net_buf *buf, if (!buf) { return -ENOBUFS; } - } else { - /* `cmd(buf)` depends on this */ - if (net_buf_pool_get(buf->pool_id) != &hci_cmd_pool) { - __ASSERT_NO_MSG(false); - return -EINVAL; - } } LOG_DBG("buf %p opcode 0x%04x len %u", buf, opcode, buf->len); From 7ba2d3d3d13b60b91fb84f6d16fd109ac42f7da4 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 205/825] Revert "[nrf fromtree] bluetooth: host: Use K_WORK replace delayable" This reverts commit 296e3f827ea890a0d0f66da728380a7d6b8cf283. --- subsys/bluetooth/host/hci_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 3c03f80a1e6..4ef9366da8b 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -4668,10 +4668,10 @@ static void tx_processor(struct k_work *item) } } -static K_WORK_DEFINE(tx_work, tx_processor); +K_WORK_DELAYABLE_DEFINE(tx_work, tx_processor); void bt_tx_irq_raise(void) { LOG_DBG("kick TX"); - k_work_submit(&tx_work); + k_work_reschedule(&tx_work, K_NO_WAIT); } From 388f5dfe6facc9e448914c3a3cc0ca9398e60f6f Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 206/825] Revert "[nrf fromtree] Bluetooth: Host: Define bt_security_err_to_str()" This reverts commit 5481e427ea04037e60f1c74374d9d8d9cb97197b. --- include/zephyr/bluetooth/conn.h | 6 ------ subsys/bluetooth/host/smp.c | 27 --------------------------- tests/bluetooth/smp/src/main.c | 19 ------------------- 3 files changed, 52 deletions(-) diff --git a/include/zephyr/bluetooth/conn.h b/include/zephyr/bluetooth/conn.h index ff1aed7ace8..32c9aa9f11e 100644 --- a/include/zephyr/bluetooth/conn.h +++ b/include/zephyr/bluetooth/conn.h @@ -1286,12 +1286,6 @@ int bt_conn_cb_unregister(struct bt_conn_cb *cb); _CONCAT(bt_conn_cb_, \ _name)) -/** Converts a security error to string. - * - * @return The string representation of the security error code. - */ -const char *bt_security_err_to_str(enum bt_security_err err); - /** @brief Enable/disable bonding. * * Set/clear the Bonding flag in the Authentication Requirements of diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 4b35b9d2da5..772c791f553 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -475,33 +475,6 @@ static enum bt_security_err security_err_get(uint8_t smp_err) } } -const char *bt_security_err_to_str(enum bt_security_err err) -{ - #define SEC_ERR(err) [err] = #err - - const char * const mapping_table[] = { - SEC_ERR(BT_SECURITY_ERR_SUCCESS), - SEC_ERR(BT_SECURITY_ERR_AUTH_FAIL), - SEC_ERR(BT_SECURITY_ERR_PIN_OR_KEY_MISSING), - SEC_ERR(BT_SECURITY_ERR_OOB_NOT_AVAILABLE), - SEC_ERR(BT_SECURITY_ERR_AUTH_REQUIREMENT), - SEC_ERR(BT_SECURITY_ERR_PAIR_NOT_SUPPORTED), - SEC_ERR(BT_SECURITY_ERR_PAIR_NOT_ALLOWED), - SEC_ERR(BT_SECURITY_ERR_INVALID_PARAM), - SEC_ERR(BT_SECURITY_ERR_KEY_REJECTED), - SEC_ERR(BT_SECURITY_ERR_UNSPECIFIED), - }; - - if (err < ARRAY_SIZE(mapping_table) && mapping_table[err]) { - return mapping_table[err]; - } else { - return "(unknown)"; - } - - #undef SEC_ERR -} - - static uint8_t smp_err_get(enum bt_security_err auth_err) { switch (auth_err) { diff --git a/tests/bluetooth/smp/src/main.c b/tests/bluetooth/smp/src/main.c index 27090442961..dfaede66431 100644 --- a/tests/bluetooth/smp/src/main.c +++ b/tests/bluetooth/smp/src/main.c @@ -36,22 +36,3 @@ ZTEST(test_smp, test_bt_smp_err_to_str) zassert_not_null(bt_smp_err_to_str(i), ": %d", i); } } - -ZTEST(test_smp, test_bt_security_err_to_str) -{ - /* Test a couple of entries */ - zassert_str_equal(bt_security_err_to_str(BT_SECURITY_ERR_AUTH_FAIL), - "BT_SECURITY_ERR_AUTH_FAIL"); - zassert_str_equal(bt_security_err_to_str(BT_SECURITY_ERR_KEY_REJECTED), - "BT_SECURITY_ERR_KEY_REJECTED"); - zassert_str_equal(bt_security_err_to_str(BT_SECURITY_ERR_UNSPECIFIED), - "BT_SECURITY_ERR_UNSPECIFIED"); - - /* Test outside range */ - zassert_str_equal(bt_security_err_to_str(BT_SECURITY_ERR_UNSPECIFIED + 1), - "(unknown)"); - - for (uint16_t i = 0; i <= UINT8_MAX; i++) { - zassert_not_null(bt_security_err_to_str(i), ": %d", i); - } -} From f4b1b8c8a1a14428ead92dd0000e9144b3cbd3d6 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 207/825] Revert "[nrf fromtree] Bluetooth: Host: Define bt_smp_err_to_str()" This reverts commit aa78a426944dcfb6e2aba8e59db0f175701b8ace. --- subsys/bluetooth/host/smp.c | 32 ------------------------- subsys/bluetooth/host/smp.h | 15 ------------ tests/bluetooth/smp/CMakeLists.txt | 8 ------- tests/bluetooth/smp/prj.conf | 10 -------- tests/bluetooth/smp/src/main.c | 38 ------------------------------ tests/bluetooth/smp/test.overlay | 5 ---- tests/bluetooth/smp/testcase.yaml | 16 ------------- 7 files changed, 124 deletions(-) delete mode 100644 tests/bluetooth/smp/CMakeLists.txt delete mode 100644 tests/bluetooth/smp/prj.conf delete mode 100644 tests/bluetooth/smp/src/main.c delete mode 100644 tests/bluetooth/smp/test.overlay delete mode 100644 tests/bluetooth/smp/testcase.yaml diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 772c791f553..02b66587d44 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -500,38 +500,6 @@ static uint8_t smp_err_get(enum bt_security_err auth_err) } } -const char *bt_smp_err_to_str(uint8_t smp_err) -{ - #define SMP_ERR(err) [err] = #err - - const char * const mapping_table[] = { - SMP_ERR(BT_SMP_ERR_SUCCESS), - SMP_ERR(BT_SMP_ERR_PASSKEY_ENTRY_FAILED), - SMP_ERR(BT_SMP_ERR_OOB_NOT_AVAIL), - SMP_ERR(BT_SMP_ERR_AUTH_REQUIREMENTS), - SMP_ERR(BT_SMP_ERR_CONFIRM_FAILED), - SMP_ERR(BT_SMP_ERR_PAIRING_NOTSUPP), - SMP_ERR(BT_SMP_ERR_ENC_KEY_SIZE), - SMP_ERR(BT_SMP_ERR_CMD_NOTSUPP), - SMP_ERR(BT_SMP_ERR_UNSPECIFIED), - SMP_ERR(BT_SMP_ERR_REPEATED_ATTEMPTS), - SMP_ERR(BT_SMP_ERR_INVALID_PARAMS), - SMP_ERR(BT_SMP_ERR_DHKEY_CHECK_FAILED), - SMP_ERR(BT_SMP_ERR_NUMERIC_COMP_FAILED), - SMP_ERR(BT_SMP_ERR_BREDR_PAIRING_IN_PROGRESS), - SMP_ERR(BT_SMP_ERR_CROSS_TRANSP_NOT_ALLOWED), - SMP_ERR(BT_SMP_ERR_KEY_REJECTED), - }; - - if (smp_err < ARRAY_SIZE(mapping_table) && mapping_table[smp_err]) { - return mapping_table[smp_err]; - } else { - return "(unknown)"; - } - - #undef SMP_ERR -} - static struct net_buf *smp_create_pdu(struct bt_smp *smp, uint8_t op, size_t len) { struct bt_smp_hdr *hdr; diff --git a/subsys/bluetooth/host/smp.h b/subsys/bluetooth/host/smp.h index 3ec68d3b670..21207a0cb8d 100644 --- a/subsys/bluetooth/host/smp.h +++ b/subsys/bluetooth/host/smp.h @@ -13,7 +13,6 @@ struct bt_smp_hdr { uint8_t code; } __packed; -#define BT_SMP_ERR_SUCCESS 0x00 #define BT_SMP_ERR_PASSKEY_ENTRY_FAILED 0x01 #define BT_SMP_ERR_OOB_NOT_AVAIL 0x02 #define BT_SMP_ERR_AUTH_REQUIREMENTS 0x03 @@ -179,17 +178,3 @@ int bt_smp_sign(struct bt_conn *conn, struct net_buf *buf); /** Generate IRK from Identity Root (IR) */ int bt_smp_irk_get(uint8_t *ir, uint8_t *irk); - -/** Converts a SMP error to string. - * - * The error codes are described in the Bluetooth Core specification, - * Vol 3, Part H, Section 3.5.5. - * - * The Security Manager Protocol documentation found in Vol 4, Part H, - * describes when the different error codes are used. - * - * See also the defined BT_SMP_ERR_* macros. - * - * @return The string representation of the SMP error code. - */ -const char *bt_smp_err_to_str(uint8_t smp_err); diff --git a/tests/bluetooth/smp/CMakeLists.txt b/tests/bluetooth/smp/CMakeLists.txt deleted file mode 100644 index 5ce6129ca35..00000000000 --- a/tests/bluetooth/smp/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(bluetooth_gatt) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/tests/bluetooth/smp/prj.conf b/tests/bluetooth/smp/prj.conf deleted file mode 100644 index a5d4251d5ff..00000000000 --- a/tests/bluetooth/smp/prj.conf +++ /dev/null @@ -1,10 +0,0 @@ -CONFIG_TEST=y -CONFIG_ZTEST=y - -CONFIG_BT=y -CONFIG_BT_SMP=y -CONFIG_BT_CTLR=n -CONFIG_BT_H4=n - -CONFIG_LOG=y -CONFIG_BT_PERIPHERAL=y diff --git a/tests/bluetooth/smp/src/main.c b/tests/bluetooth/smp/src/main.c deleted file mode 100644 index dfaede66431..00000000000 --- a/tests/bluetooth/smp/src/main.c +++ /dev/null @@ -1,38 +0,0 @@ -/* main.c - Application main entry point */ - -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include - -#include -#include -#include <../subsys/bluetooth/host/smp.h> - -ZTEST_SUITE(test_smp, NULL, NULL, NULL, NULL, NULL); - -ZTEST(test_smp, test_bt_smp_err_to_str) -{ - /* Test a couple of entries */ - zassert_str_equal(bt_smp_err_to_str(0x00), - "BT_SMP_ERR_SUCCESS"); - zassert_str_equal(bt_smp_err_to_str(0x0a), - "BT_SMP_ERR_INVALID_PARAMS"); - zassert_str_equal(bt_smp_err_to_str(0x0F), - "BT_SMP_ERR_KEY_REJECTED"); - - /* Test entries that are not used */ - zassert_mem_equal(bt_smp_err_to_str(0x10), - "(unknown)", strlen("(unknown)")); - zassert_mem_equal(bt_smp_err_to_str(0xFF), - "(unknown)", strlen("(unknown)")); - - for (uint16_t i = 0; i <= UINT8_MAX; i++) { - zassert_not_null(bt_smp_err_to_str(i), ": %d", i); - } -} diff --git a/tests/bluetooth/smp/test.overlay b/tests/bluetooth/smp/test.overlay deleted file mode 100644 index badbe2f392a..00000000000 --- a/tests/bluetooth/smp/test.overlay +++ /dev/null @@ -1,5 +0,0 @@ -/ { - chosen { - /delete-property/ zephyr,bt-hci; - }; -}; diff --git a/tests/bluetooth/smp/testcase.yaml b/tests/bluetooth/smp/testcase.yaml deleted file mode 100644 index d55503ba615..00000000000 --- a/tests/bluetooth/smp/testcase.yaml +++ /dev/null @@ -1,16 +0,0 @@ -tests: - bluetooth.smp: - extra_args: - - EXTRA_DTC_OVERLAY_FILE="test.overlay" - platform_allow: - - native_posix - - native_posix/native/64 - - native_sim - - native_sim/native/64 - - qemu_x86 - - qemu_cortex_m3 - integration_platforms: - - native_sim - tags: - - bluetooth - - smp From 40daddf2504beac4b69c57011fcc83c8b9559afe Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 208/825] Revert "[nrf fromtree] Bluetooth: l2cap: service as much TX channels as possible" This reverts commit 55d27d0e1f8f2a17dd43b07bc0a58f61a69cea6a. --- subsys/bluetooth/host/l2cap.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 9e20037f52f..e38a9bd8357 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -861,7 +861,6 @@ struct net_buf *l2cap_data_pull(struct bt_conn *conn, if (!lechan) { LOG_DBG("no channel conn %p", conn); - bt_tx_irq_raise(); return NULL; } @@ -874,7 +873,6 @@ struct net_buf *l2cap_data_pull(struct bt_conn *conn, struct net_buf *pdu = k_fifo_peek_head(&lechan->tx_queue); if (!pdu) { - bt_tx_irq_raise(); return NULL; } /* __ASSERT(pdu, "signaled ready but no PDUs in the TX queue"); */ From b6cb6ba59058e8cbf32ef64d1f25885c20e482d3 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:00 +0200 Subject: [PATCH 209/825] Revert "[nrf fromtree] Bluetooth: iso: make TX path service all connections" This reverts commit 28d304efc4cea4430aa8bb9a97469545698625e1. --- subsys/bluetooth/host/iso.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c index 6ee05e17ad5..879656725b6 100644 --- a/subsys/bluetooth/host/iso.c +++ b/subsys/bluetooth/host/iso.c @@ -750,9 +750,6 @@ static struct net_buf *iso_data_pull(struct bt_conn *conn, if (!frag) { LOG_DBG("signaled ready but no frag available"); - /* Service other connections */ - bt_tx_irq_raise(); - return NULL; } @@ -762,9 +759,6 @@ static struct net_buf *iso_data_pull(struct bt_conn *conn, LOG_DBG("channel has been disconnected"); __ASSERT_NO_MSG(b == frag); - /* Service other connections */ - bt_tx_irq_raise(); - return NULL; } From c0d2b54ea61f818712950f121dc980f1bcf2021e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 210/825] Revert "[nrf fromtree] Bluetooth: Host: Fix deprecation and versioning for HCI APIs" This reverts commit 64e20d269f94aed7f6763b79fbdab324cbd95e1d. --- include/zephyr/drivers/bluetooth.h | 4 ---- include/zephyr/drivers/bluetooth/hci_driver.h | 3 --- 2 files changed, 7 deletions(-) diff --git a/include/zephyr/drivers/bluetooth.h b/include/zephyr/drivers/bluetooth.h index 1492b647557..f447c76b792 100644 --- a/include/zephyr/drivers/bluetooth.h +++ b/include/zephyr/drivers/bluetooth.h @@ -11,10 +11,6 @@ /** * @brief Bluetooth HCI APIs * @defgroup bt_hci_api Bluetooth HCI APIs - * - * @since 3.7 - * @version 0.2.0 - * * @ingroup bluetooth * @{ */ diff --git a/include/zephyr/drivers/bluetooth/hci_driver.h b/include/zephyr/drivers/bluetooth/hci_driver.h index b11d1523f89..0aaf7bac583 100644 --- a/include/zephyr/drivers/bluetooth/hci_driver.h +++ b/include/zephyr/drivers/bluetooth/hci_driver.h @@ -12,9 +12,6 @@ /** * @brief HCI drivers - * - * @deprecated This is the old HCI driver API. Drivers should use @ref bt_hci_api instead. - * * @defgroup bt_hci_driver HCI drivers * @ingroup bluetooth * @{ From 98273aa56affb884e844d08b57dade3971c1ec29 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 211/825] Revert "[nrf fromtree] Bluetooth: doc: Add missing doc in bt_gatt_attr" This reverts commit 3214c6bd8109fa05902fe1f1f8ecdfa3d201bb5b. --- include/zephyr/bluetooth/gatt.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/zephyr/bluetooth/gatt.h b/include/zephyr/bluetooth/gatt.h index 6ee226f31cf..7a9657f645b 100644 --- a/include/zephyr/bluetooth/gatt.h +++ b/include/zephyr/bluetooth/gatt.h @@ -169,7 +169,6 @@ typedef ssize_t (*bt_gatt_attr_write_func_t)(struct bt_conn *conn, struct bt_gatt_attr { /** Attribute UUID */ const struct bt_uuid *uuid; - /** Attribute read callback */ bt_gatt_attr_read_func_t read; /** Attribute write callback */ bt_gatt_attr_write_func_t write; From defd5cceb02faaf16953dbc2ed0f69347ccf2aab Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 212/825] Revert "[nrf fromtree] Bluetooth: Host: Add Per Adv Sync handle getter" This reverts commit 69a047f70784445f9e3851d6714b809f372664d0. --- include/zephyr/bluetooth/hci.h | 9 --------- subsys/bluetooth/host/hci_core.c | 13 ------------- 2 files changed, 22 deletions(-) diff --git a/include/zephyr/bluetooth/hci.h b/include/zephyr/bluetooth/hci.h index 7dfcb227527..a73bf314652 100644 --- a/include/zephyr/bluetooth/hci.h +++ b/include/zephyr/bluetooth/hci.h @@ -111,15 +111,6 @@ int bt_hci_get_conn_handle(const struct bt_conn *conn, uint16_t *conn_handle); */ int bt_hci_get_adv_handle(const struct bt_le_ext_adv *adv, uint8_t *adv_handle); -/** @brief Get periodic advertising sync handle. - * - * @param sync Periodic advertising sync set. - * @param sync_handle Place to store the periodic advertising sync handle. - * - * @return 0 on success or negative error value on failure. - */ -int bt_hci_get_adv_sync_handle(const struct bt_le_per_adv_sync *sync, uint16_t *sync_handle); - /** @brief Obtain the version string given a core version number. * * The core version of a controller can be obtained by issuing diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 4ef9366da8b..5e61736232e 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -2555,19 +2555,6 @@ int bt_hci_get_adv_handle(const struct bt_le_ext_adv *adv, uint8_t *adv_handle) } #endif /* CONFIG_BT_EXT_ADV */ -#if defined(CONFIG_BT_PER_ADV_SYNC) -int bt_hci_get_adv_sync_handle(const struct bt_le_per_adv_sync *sync, uint16_t *sync_handle) -{ - if (!atomic_test_bit(sync->flags, BT_PER_ADV_SYNC_CREATED)) { - return -EINVAL; - } - - *sync_handle = sync->handle; - - return 0; -} -#endif - #if defined(CONFIG_BT_HCI_VS_EVT_USER) int bt_hci_register_vnd_evt_cb(bt_hci_vnd_evt_cb_t cb) { From 29a1cb59e9c025675243fe43c6b92c6ab7f0d831 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 213/825] Revert "[nrf fromtree] Bluetooth: host: don't pull data if no view bufs" This reverts commit dc0679d73cef071e30cdca4510d97dc384ed6b7c. --- subsys/bluetooth/host/conn.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index bd74df154b9..6be2b178d40 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -667,9 +667,6 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, frag = get_data_frag(buf, frag_len); } - /* Caller is supposed to check we have all resources to send */ - __ASSERT_NO_MSG(frag != NULL); - /* If the current buffer doesn't fit a controller buffer */ if (len > conn_mtu(conn)) { flags = conn->next_is_frag ? FRAG_CONT : FRAG_START; @@ -821,25 +818,6 @@ static bool cannot_send_to_controller(struct bt_conn *conn) return k_sem_count_get(bt_conn_get_pkts(conn)) == 0; } -static bool dont_have_viewbufs(void) -{ -#if defined(CONFIG_BT_CONN_TX) - /* The LIFO only tracks buffers that have been destroyed at least once, - * hence the uninit check beforehand. - */ - if (fragments.uninit_count > 0) { - /* If there are uninitialized bufs, we are guaranteed allocation. */ - return false; - } - - /* In practice k_fifo == k_lifo ABI. */ - return k_fifo_is_empty(&fragments.free); - -#else /* !CONFIG_BT_CONN_TX */ - return false; -#endif /* CONFIG_BT_CONN_TX */ -} - static bool dont_have_methods(struct bt_conn *conn) { return (conn->tx_data_pull == NULL) || @@ -860,14 +838,6 @@ struct bt_conn *get_conn_ready(void) struct bt_conn *conn = CONTAINER_OF(node, struct bt_conn, _conn_ready); - if (dont_have_viewbufs()) { - /* We will get scheduled again when the (view) buffers are freed. If you - * hit this a lot, try increasing `CONFIG_BT_CONN_FRAG_COUNT` - */ - LOG_DBG("no view bufs"); - return NULL; - } - if (cannot_send_to_controller(conn)) { /* We will get scheduled again when the buffers are freed. */ LOG_DBG("no LL bufs for %p", conn); From b536b7cca05ab13bdc9a32aa66278e32fb3fe05d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 214/825] Revert "[nrf fromtree] Bluetooth: host: use `__maybe_unused` for convenience variables" This reverts commit 883f978f67a03155559232cee97b6645801987e8. --- subsys/bluetooth/host/classic/l2cap_br.c | 9 ++++++--- subsys/bluetooth/host/conn.c | 7 +++++-- subsys/bluetooth/host/hci_core.c | 3 ++- subsys/bluetooth/host/iso.c | 9 ++++----- subsys/bluetooth/host/l2cap.c | 9 ++++++--- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/subsys/bluetooth/host/classic/l2cap_br.c b/subsys/bluetooth/host/classic/l2cap_br.c index b447d280c04..41009aad264 100644 --- a/subsys/bluetooth/host/classic/l2cap_br.c +++ b/subsys/bluetooth/host/classic/l2cap_br.c @@ -257,13 +257,15 @@ static void raise_data_ready(struct bt_l2cap_br_chan *br_chan) static void lower_data_ready(struct bt_l2cap_br_chan *br_chan) { struct bt_conn *conn = br_chan->chan.conn; - __maybe_unused sys_snode_t *s = sys_slist_get(&conn->l2cap_data_ready); + sys_snode_t *s = sys_slist_get(&conn->l2cap_data_ready); __ASSERT_NO_MSG(s == &br_chan->_pdu_ready); + (void)s; - __maybe_unused atomic_t old = atomic_set(&br_chan->_pdu_ready_lock, 0); + atomic_t old = atomic_set(&br_chan->_pdu_ready_lock, 0); __ASSERT_NO_MSG(old); + (void)old; } static void cancel_data_ready(struct bt_l2cap_br_chan *br_chan) @@ -381,9 +383,10 @@ struct net_buf *l2cap_br_data_pull(struct bt_conn *conn, if (last_frag) { LOG_DBG("last frag, removing %p", pdu); - __maybe_unused struct net_buf *b = k_fifo_get(&br_chan->_pdu_tx_queue, K_NO_WAIT); + struct net_buf *b = k_fifo_get(&br_chan->_pdu_tx_queue, K_NO_WAIT); __ASSERT_NO_MSG(b == pdu); + (void)b; 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 6be2b178d40..4d8ff9517d7 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -858,16 +858,19 @@ struct bt_conn *get_conn_ready(void) } if (should_stop_tx(conn)) { - __maybe_unused sys_snode_t *s = sys_slist_get(&bt_dev.le.conn_ready); + sys_snode_t *s = sys_slist_get(&bt_dev.le.conn_ready); __ASSERT_NO_MSG(s == node); + (void)s; - (void)atomic_set(&conn->_conn_ready_lock, 0); + atomic_t old = atomic_set(&conn->_conn_ready_lock, 0); /* Note: we can't assert `old` is non-NULL here, as the * connection might have been marked ready by an l2cap channel * that cancelled its request to send. */ + (void)old; + /* Append connection to list if it still has data */ if (conn->has_data(conn)) { LOG_DBG("appending %p to back of TX queue", conn); diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 5e61736232e..07ffd4c849a 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -392,9 +392,10 @@ int bt_hci_cmd_send_sync(uint16_t opcode, struct net_buf *buf, * to map the opcode to the HCI command documentation. * Example: 0x0c03 represents HCI_Reset command. */ - __maybe_unused bool success = process_pending_cmd(HCI_CMD_TIMEOUT); + bool success = process_pending_cmd(HCI_CMD_TIMEOUT); BT_ASSERT_MSG(success, "command opcode 0x%04x timeout", opcode); + (void)success; /* cmon zephyr fix your assert macros */ } while (buf != cmd); } diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c index 879656725b6..7198501ef0f 100644 --- a/subsys/bluetooth/host/iso.c +++ b/subsys/bluetooth/host/iso.c @@ -754,11 +754,10 @@ static struct net_buf *iso_data_pull(struct bt_conn *conn, } 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"); + struct net_buf *b = k_fifo_get(&conn->iso.txq, K_NO_WAIT); + (void)b; __ASSERT_NO_MSG(b == frag); - return NULL; } @@ -773,9 +772,9 @@ static struct net_buf *iso_data_pull(struct bt_conn *conn, bool last_frag = amount >= frag->len; if (last_frag) { - __maybe_unused struct net_buf *b = k_fifo_get(&conn->iso.txq, K_NO_WAIT); - LOG_DBG("last frag, pop buf"); + struct net_buf *b = k_fifo_get(&conn->iso.txq, K_NO_WAIT); + (void)b; __ASSERT_NO_MSG(b == frag); } diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index e38a9bd8357..2951538343c 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -674,15 +674,17 @@ static void raise_data_ready(struct bt_l2cap_le_chan *le_chan) static void lower_data_ready(struct bt_l2cap_le_chan *le_chan) { struct bt_conn *conn = le_chan->chan.conn; - __maybe_unused sys_snode_t *s = sys_slist_get(&conn->l2cap_data_ready); + sys_snode_t *s = sys_slist_get(&conn->l2cap_data_ready); LOG_DBG("%p", le_chan); __ASSERT_NO_MSG(s == &le_chan->_pdu_ready); + (void)s; - __maybe_unused atomic_t old = atomic_set(&le_chan->_pdu_ready_lock, 0); + atomic_t old = atomic_set(&le_chan->_pdu_ready_lock, 0); __ASSERT_NO_MSG(old); + (void)old; } static void cancel_data_ready(struct bt_l2cap_le_chan *le_chan) @@ -921,9 +923,10 @@ 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); - __maybe_unused struct net_buf *b = k_fifo_get(&lechan->tx_queue, K_NO_WAIT); + struct net_buf *b = k_fifo_get(&lechan->tx_queue, K_NO_WAIT); __ASSERT_NO_MSG(b == pdu); + (void)b; if (L2CAP_LE_CID_IS_DYN(lechan->tx.cid)) { LOG_DBG("adding `sdu_sent` callback"); From fcb7f90182ec66e011850849673ea66723ccd8ad Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 215/825] Revert "[nrf fromtree] Bluetooth: L2CAP: remove seg_pool" This reverts commit 0b8f95d1d103de02c5e3f9b4c6b4eb8c99676a2a. --- include/zephyr/bluetooth/l2cap.h | 10 +- subsys/bluetooth/host/buf.c | 5 + subsys/bluetooth/host/classic/l2cap_br.c | 6 +- .../host/classic/l2cap_br_interface.h | 4 +- subsys/bluetooth/host/conn.c | 55 +- subsys/bluetooth/host/conn_internal.h | 4 +- subsys/bluetooth/host/iso.c | 10 +- subsys/bluetooth/host/l2cap.c | 615 ++++++++++++------ 8 files changed, 454 insertions(+), 255 deletions(-) diff --git a/include/zephyr/bluetooth/l2cap.h b/include/zephyr/bluetooth/l2cap.h index f471c925379..4525aef6a8b 100644 --- a/include/zephyr/bluetooth/l2cap.h +++ b/include/zephyr/bluetooth/l2cap.h @@ -190,9 +190,13 @@ struct bt_l2cap_le_chan { * L2CAP_LE_CREDIT_BASED_CONNECTION_REQ/RSP or L2CAP_CONFIGURATION_REQ. */ struct bt_l2cap_le_endpoint tx; +#if defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL) /** Channel Transmission queue (for SDUs) */ struct k_fifo tx_queue; -#if defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL) + /** Channel Pending Transmission buffer */ + struct net_buf *tx_buf; + /** Channel Transmission work */ + struct k_work_delayable tx_work; /** Segment SDU packet from upper layer */ struct net_buf *_sdu; uint16_t _sdu_len; @@ -219,8 +223,8 @@ struct bt_l2cap_le_chan { sys_snode_t _pdu_ready; /** @internal To be used with @ref bt_conn.upper_data_ready */ atomic_t _pdu_ready_lock; - /** @internal Holds the length of the current PDU/segment */ - size_t _pdu_remaining; + /** @internal Queue of net bufs not yet sent to lower layer */ + struct k_fifo _pdu_tx_queue; }; /** diff --git a/subsys/bluetooth/host/buf.c b/subsys/bluetooth/host/buf.c index a1d107cf654..7dad7a67aec 100644 --- a/subsys/bluetooth/host/buf.c +++ b/subsys/bluetooth/host/buf.c @@ -164,6 +164,11 @@ struct net_buf *bt_buf_make_view(struct net_buf *view, */ __ASSERT_NO_MSG(net_buf_headroom(parent) > 0); + /* `parent` should have been just re-used instead of trying to make a + * view into it. + */ + __ASSERT_NO_MSG(len < parent->len); + __ASSERT_NO_MSG(!bt_buf_has_view(parent)); LOG_DBG("make-view %p viewsize %u meta %p", view, len, meta); diff --git a/subsys/bluetooth/host/classic/l2cap_br.c b/subsys/bluetooth/host/classic/l2cap_br.c index 41009aad264..67ab2a74feb 100644 --- a/subsys/bluetooth/host/classic/l2cap_br.c +++ b/subsys/bluetooth/host/classic/l2cap_br.c @@ -348,9 +348,7 @@ static bool chan_has_data(struct bt_l2cap_br_chan *br_chan) return !k_fifo_is_empty(&br_chan->_pdu_tx_queue); } -struct net_buf *l2cap_br_data_pull(struct bt_conn *conn, - size_t amount, - size_t *length) +struct net_buf *l2cap_br_data_pull(struct bt_conn *conn, size_t amount) { const sys_snode_t *pdu_ready = sys_slist_peek_head(&conn->l2cap_data_ready); @@ -398,8 +396,6 @@ struct net_buf *l2cap_br_data_pull(struct bt_conn *conn, } } - *length = pdu->len; - return pdu; } diff --git a/subsys/bluetooth/host/classic/l2cap_br_interface.h b/subsys/bluetooth/host/classic/l2cap_br_interface.h index 79e107378f3..340fa619694 100644 --- a/subsys/bluetooth/host/classic/l2cap_br_interface.h +++ b/subsys/bluetooth/host/classic/l2cap_br_interface.h @@ -48,6 +48,4 @@ void l2cap_br_encrypt_change(struct bt_conn *conn, uint8_t hci_status); void bt_l2cap_br_recv(struct bt_conn *conn, struct net_buf *buf); /* Pull HCI fragments from buffers intended for `conn` */ -struct net_buf *l2cap_br_data_pull(struct bt_conn *conn, - size_t amount, - size_t *length); +struct net_buf *l2cap_br_data_pull(struct bt_conn *conn, size_t amount); diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 4d8ff9517d7..4776b2e7bac 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -152,7 +152,9 @@ static struct net_buf *get_data_frag(struct net_buf *outside, size_t winsize) return window; } - window = bt_buf_make_view(window, outside, + __ASSERT_NO_MSG(outside->ref == 1); + + window = bt_buf_make_view(window, net_buf_ref(outside), winsize, &get_frag_md(window)->view_meta); LOG_DBG("get-acl-frag: outside %p window %p size %d", outside, window, winsize); @@ -606,7 +608,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, void *cb, void *ud) + void *cb, void *ud) { struct net_buf *frag = NULL; struct bt_conn_tx *tx = NULL; @@ -625,7 +627,7 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, return -EIO; } - LOG_DBG("conn %p buf %p len %u buf->len %u", conn, buf, len, buf->len); + LOG_DBG("conn %p buf %p len %u", conn, buf, buf->len); /* Acquire the right to send 1 packet to the controller */ if (k_sem_take(bt_conn_get_pkts(conn), K_NO_WAIT)) { @@ -652,23 +654,17 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, tx->cb = cb; tx->user_data = ud; - uint16_t frag_len = MIN(conn_mtu(conn), len); + /* If the current buffer doesn't fit a controller buffer */ + if (buf->len > conn_mtu(conn)) { + uint16_t frag_len = MIN(conn_mtu(conn), buf->len); - __ASSERT_NO_MSG(buf->ref == 1); + LOG_DBG("send frag: buf %p len %d", 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. + /* get a view into `buf`, sized `frag_len`. Also pull + * `frag_len` bytes from `buf`. */ frag = get_data_frag(buf, frag_len); - } - /* If the current buffer doesn't fit a controller buffer */ - if (len > conn_mtu(conn)) { flags = conn->next_is_frag ? FRAG_CONT : FRAG_START; conn->next_is_frag = true; } else { @@ -676,13 +672,11 @@ 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", buf, frag_len); - /* At this point, the buffer is either a fragment or a full HCI packet. * The flags are also valid. */ LOG_DBG("conn %p buf %p len %u flags 0x%02x", - conn, frag, frag->len, flags); + conn, frag ? frag : buf, buf->len, flags); /* Keep track of sent buffers. We have to append _before_ * sending, as we might get pre-empted if the HCI driver calls @@ -696,9 +690,9 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, sys_slist_append(&conn->tx_pending, &tx->node); if (is_iso_tx_conn(conn)) { - err = send_iso(conn, frag, flags); + err = send_iso(conn, frag ? frag : buf, flags); } else if (is_acl_conn(conn)) { - err = send_acl(conn, frag, flags); + err = send_acl(conn, frag ? frag : buf, flags); } else { err = -EINVAL; /* Some animals disable asserts (╯°□°)╯︵ ┻━┻ */ __ASSERT(false, "Invalid connection type %u", conn->type); @@ -714,10 +708,13 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf, LOG_ERR("Unable to send to driver (err %d)", err); - /* If we get here, something has seriously gone wrong: the `parent` buf - * (of which the current fragment belongs) should also be destroyed. + /* If we get here, something has seriously gone wrong: The caller should + * also destroy the `parent` buf (of which the current fragment + * belongs). */ - net_buf_unref(frag); + if (frag) { + net_buf_unref(frag); + } /* `buf` might not get destroyed right away, and its `tx` * pointer will still be reachable. Make sure that we don't try @@ -937,7 +934,6 @@ void bt_conn_tx_processor(void) struct bt_conn *conn; struct net_buf *buf; bt_conn_tx_cb_t cb = NULL; - size_t buf_len; void *ud = NULL; if (!IS_ENABLED(CONFIG_BT_CONN_TX)) { @@ -963,10 +959,10 @@ void bt_conn_tx_processor(void) /* Call the user callbacks & destroy (final-unref) the buffers * we were supposed to send. */ - buf = conn->tx_data_pull(conn, SIZE_MAX, &buf_len); + buf = conn->tx_data_pull(conn, conn_mtu(conn)); while (buf) { destroy_and_callback(conn, buf, cb, ud); - buf = conn->tx_data_pull(conn, SIZE_MAX, &buf_len); + buf = conn->tx_data_pull(conn, conn_mtu(conn)); } return; } @@ -974,7 +970,7 @@ void bt_conn_tx_processor(void) /* now that we are guaranteed resources, we can pull data from the upper * layer (L2CAP or ISO). */ - buf = conn->tx_data_pull(conn, conn_mtu(conn), &buf_len); + buf = conn->tx_data_pull(conn, conn_mtu(conn)); if (!buf) { /* Either there is no more data, or the buffer is already in-use * by a view on it. In both cases, the TX processor will be @@ -985,9 +981,8 @@ void bt_conn_tx_processor(void) return; } - bool last_buf = conn_mtu(conn) >= buf_len; + bool last_buf = conn_mtu(conn) >= buf->len; - /* TODO: add sdu_sent callback on last PDU */ if (last_buf) { /* Only pull the callback info from the last buffer. * We still allocate one TX context per-fragment though. @@ -999,7 +994,7 @@ void bt_conn_tx_processor(void) LOG_DBG("TX process: conn %p buf %p (%s)", conn, buf, last_buf ? "last" : "frag"); - int err = send_buf(conn, buf, buf_len, cb, ud); + int err = send_buf(conn, buf, cb, ud); if (err) { /* -EIO means `unrecoverable error`. It can be an assertion that diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index 61664048cd7..fffb0d453a2 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -269,9 +269,7 @@ struct bt_conn { * Scheduling from which channel to pull (e.g. for L2CAP) is done at the * upper layer's discretion. */ - struct net_buf * (*tx_data_pull)(struct bt_conn *conn, - size_t amount, - size_t *length); + struct net_buf * (*tx_data_pull)(struct bt_conn *conn, size_t amount); /* Get (and clears for ACL conns) callback and user-data for `buf`. */ void (*get_and_clear_cb)(struct bt_conn *conn, struct net_buf *buf, diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c index 7198501ef0f..298e7732df2 100644 --- a/subsys/bluetooth/host/iso.c +++ b/subsys/bluetooth/host/iso.c @@ -138,9 +138,7 @@ void hci_iso(struct net_buf *buf) } /* Pull data from the ISO layer */ -static struct net_buf *iso_data_pull(struct bt_conn *conn, - size_t amount, - size_t *length); +static struct net_buf *iso_data_pull(struct bt_conn *conn, size_t amount); /* Returns true if the ISO layer has data to send on this conn */ static bool iso_has_data(struct bt_conn *conn); @@ -736,9 +734,7 @@ static bool iso_has_data(struct bt_conn *conn) #endif /* CONFIG_BT_ISO_TX */ } -static struct net_buf *iso_data_pull(struct bt_conn *conn, - size_t amount, - size_t *length) +static struct net_buf *iso_data_pull(struct bt_conn *conn, size_t amount) { #if defined(CONFIG_BT_ISO_TX) LOG_DBG("conn %p amount %d", conn, amount); @@ -778,8 +774,6 @@ static struct net_buf *iso_data_pull(struct bt_conn *conn, __ASSERT_NO_MSG(b == frag); } - *length = frag->len; - return frag; #else return NULL; diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 2951538343c..ad6a0d01cab 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -90,6 +90,86 @@ struct bt_l2cap { static const struct bt_l2cap_ecred_cb *ecred_cb; static struct bt_l2cap bt_l2cap_pool[CONFIG_BT_MAX_CONN]; +static void seg_destroy(struct net_buf *buf); +#define SEGMENTS_COUNT CONFIG_BT_MAX_CONN +/* see equivalent struct in conn.c */ +NET_BUF_POOL_FIXED_DEFINE(seg_pool, SEGMENTS_COUNT, 0, + CONFIG_BT_CONN_TX_USER_DATA_SIZE, seg_destroy); + +struct seg_md { + struct bt_l2cap_le_chan *lechan; + struct bt_buf_view_meta view_meta; +}; + +struct seg_md seg_md_pool[SEGMENTS_COUNT]; + +struct seg_md *get_seg_md(struct net_buf *seg) +{ + return &seg_md_pool[net_buf_id(seg)]; +} + +#if defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL) +static void l2cap_chan_tx_resume(struct bt_l2cap_le_chan *ch); +#endif + +static void seg_destroy(struct net_buf *seg) +{ + /* Only relevant if there is segmentation going on. This is not possible + * for LE ACL fixed channels, only for credit-based ones. + */ +#if defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL) + struct bt_l2cap_le_chan *lechan = get_seg_md(seg)->lechan; + + get_seg_md(seg)->lechan = NULL; + + LOG_DBG("destroy %p (parent %p)", seg, lechan->tx_buf); + + /* allow next view to be allocated (and unlock the parent buf) */ + bt_buf_destroy_view(seg, &get_seg_md(seg)->view_meta); + + /* try to allocate and send next view PDU */ + l2cap_chan_tx_resume(lechan); +#endif +} + +#if defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL) +static struct net_buf *get_seg(struct net_buf *sdu, + size_t seg_size, + struct bt_l2cap_le_chan *lechan) +{ + struct net_buf *view; + + __ASSERT_NO_MSG(!bt_buf_has_view(sdu)); + + /* optimization: don't allocate if we know `make_view` will return `sdu` */ + if ((seg_size >= sdu->len) && + (net_buf_headroom(sdu) >= BT_L2CAP_BUF_SIZE(0))) { + + LOG_DBG("view >= bufsize, returning it"); + + return sdu; + } + + /* Keeping a ref is the caller's responsibility */ + view = net_buf_alloc(&seg_pool, K_NO_WAIT); + if (!view) { + /* This should never happen? If pool properly configured. */ + __ASSERT_NO_MSG(view); + return NULL; + } + + __ASSERT_NO_MSG(sdu->ref == 1); + + get_seg_md(view)->lechan = lechan; + view = bt_buf_make_view(view, net_buf_ref(sdu), + seg_size, &get_seg_md(view)->view_meta); + + LOG_DBG("alloc-w-view: sdu %p view %p size %d", sdu, view, seg_size); + + return view; +} +#endif /* CONFIG_BT_L2CAP_DYNAMIC_CHANNEL */ + void bt_l2cap_register_ecred_cb(const struct bt_l2cap_ecred_cb *cb) { ecred_cb = cb; @@ -261,7 +341,7 @@ void bt_l2cap_chan_del(struct bt_l2cap_chan *chan) * `l2cap_chan_destroy()` as it is not called for fixed channels. */ while (chan_has_data(le_chan)) { - struct net_buf *buf = net_buf_get(&le_chan->tx_queue, K_NO_WAIT); + struct net_buf *buf = net_buf_get(&le_chan->_pdu_tx_queue, K_NO_WAIT); net_buf_unref(buf); } @@ -399,7 +479,7 @@ void bt_l2cap_connected(struct bt_conn *conn) return; } - k_fifo_init(&le_chan->tx_queue); + k_fifo_init(&le_chan->_pdu_tx_queue); if (chan->ops->connected) { chan->ops->connected(chan); @@ -663,9 +743,9 @@ static void raise_data_ready(struct bt_l2cap_le_chan *le_chan) if (!atomic_set(&le_chan->_pdu_ready_lock, 1)) { sys_slist_append(&le_chan->chan.conn->l2cap_data_ready, &le_chan->_pdu_ready); - LOG_DBG("data ready raised %p", le_chan); + LOG_DBG("data ready raised"); } else { - LOG_DBG("data ready already %p", le_chan); + LOG_DBG("data ready already"); } bt_conn_data_ready(le_chan->chan.conn); @@ -676,8 +756,6 @@ static void lower_data_ready(struct bt_l2cap_le_chan *le_chan) struct bt_conn *conn = le_chan->chan.conn; sys_snode_t *s = sys_slist_get(&conn->l2cap_data_ready); - LOG_DBG("%p", le_chan); - __ASSERT_NO_MSG(s == &le_chan->_pdu_ready); (void)s; @@ -691,8 +769,6 @@ static void cancel_data_ready(struct bt_l2cap_le_chan *le_chan) { struct bt_conn *conn = le_chan->chan.conn; - LOG_DBG("%p", le_chan); - sys_slist_find_and_remove(&conn->l2cap_data_ready, &le_chan->_pdu_ready); atomic_set(&le_chan->_pdu_ready_lock, 0); @@ -701,6 +777,14 @@ static void cancel_data_ready(struct bt_l2cap_le_chan *le_chan) int bt_l2cap_send_pdu(struct bt_l2cap_le_chan *le_chan, struct net_buf *pdu, bt_conn_tx_cb_t cb, void *user_data) { + struct bt_l2cap_hdr *hdr; + + LOG_DBG("chan %p len %zu", le_chan, pdu->len); + + hdr = net_buf_push(pdu, sizeof(*hdr)); + hdr->len = sys_cpu_to_le16(pdu->len - sizeof(*hdr)); + hdr->cid = sys_cpu_to_le16(le_chan->tx.cid); + if (pdu->ref != 1) { /* The host may alter the buf contents when fragmenting. Higher * layers cannot expect the buf contents to stay intact. Extra @@ -720,9 +804,9 @@ int bt_l2cap_send_pdu(struct bt_l2cap_le_chan *le_chan, struct net_buf *pdu, } make_closure(pdu->user_data, cb, user_data); - LOG_DBG("push: pdu %p len %d cb %p userdata %p", pdu, pdu->len, cb, user_data); + LOG_DBG("push: cb %p userdata %p", cb, user_data); - net_buf_put(&le_chan->tx_queue, pdu); + net_buf_put(&le_chan->_pdu_tx_queue, pdu); raise_data_ready(le_chan); /* tis just a flag */ @@ -732,56 +816,11 @@ int bt_l2cap_send_pdu(struct bt_l2cap_le_chan *le_chan, struct net_buf *pdu, /* L2CAP channel wants to send a PDU */ static bool chan_has_data(struct bt_l2cap_le_chan *lechan) { - return !k_fifo_is_empty(&lechan->tx_queue); -} - -#if defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL) -static bool test_and_dec(atomic_t *target) -{ - atomic_t old_value, new_value; - - do { - old_value = atomic_get(target); - if (!old_value) { - return false; - } - - new_value = old_value - 1; - } while (atomic_cas(target, old_value, new_value) == 0); - - return true; -} -#endif - -/* Just like in group projects :p */ -static void chan_take_credit(struct bt_l2cap_le_chan *lechan) -{ -#if defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL) - if (!L2CAP_LE_CID_IS_DYN(lechan->tx.cid)) { - return; - } - - if (!test_and_dec(&lechan->tx.credits)) { - /* Always ensure you have credits before calling this fn */ - __ASSERT_NO_MSG(0); - } - - /* Notify channel user that it can't send anymore on this channel. */ - if (!atomic_get(&lechan->tx.credits)) { - LOG_DBG("chan %p paused", lechan); - atomic_clear_bit(lechan->chan.status, BT_L2CAP_STATUS_OUT); - - if (lechan->chan.ops->status) { - lechan->chan.ops->status(&lechan->chan, lechan->chan.status); - } - } -#endif + return !k_fifo_is_empty(&lechan->_pdu_tx_queue); } -static struct bt_l2cap_le_chan *get_ready_chan(struct bt_conn *conn) +struct net_buf *l2cap_data_pull(struct bt_conn *conn, size_t amount) { - struct bt_l2cap_le_chan *lechan; - sys_snode_t *pdu_ready = sys_slist_peek_head(&conn->l2cap_data_ready); if (!pdu_ready) { @@ -789,157 +828,41 @@ static struct bt_l2cap_le_chan *get_ready_chan(struct bt_conn *conn) return NULL; } - SYS_SLIST_FOR_EACH_CONTAINER(&conn->l2cap_data_ready, lechan, _pdu_ready) { - if (chan_has_data(lechan)) { - LOG_DBG("sending from chan %p (%s) data %d", lechan, - L2CAP_LE_CID_IS_DYN(lechan->tx.cid) ? "dynamic" : "static", - chan_has_data(lechan)); - return lechan; - } - - LOG_DBG("chan %p has no data", lechan); - lower_data_ready(lechan); - } - - return NULL; -} - -static void l2cap_chan_sdu_sent(struct bt_conn *conn, void *user_data, int err) -{ - struct bt_l2cap_chan *chan; - uint16_t cid = POINTER_TO_UINT(user_data); - - LOG_DBG("conn %p CID 0x%04x err %d", conn, cid, err); - - if (err) { - LOG_DBG("error %d when sending SDU", err); - - return; - } - - chan = bt_l2cap_le_lookup_tx_cid(conn, cid); - if (!chan) { - LOG_DBG("got SDU sent cb for disconnected chan (CID %u)", cid); - - return; - } - - if (chan->ops->sent) { - chan->ops->sent(chan); - } -} - -static uint16_t get_pdu_len(struct bt_l2cap_le_chan *lechan, - struct net_buf *buf) -{ - if (!L2CAP_LE_CID_IS_DYN(lechan->tx.cid)) { - /* No segmentation shenanigans on static channels */ - return buf->len; - } - - return MIN(buf->len, lechan->tx.mps); -} - -static bool chan_has_credits(struct bt_l2cap_le_chan *lechan) -{ -#if defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL) - if (!L2CAP_LE_CID_IS_DYN(lechan->tx.cid)) { - return true; - } - - LOG_DBG("chan %p credits %ld", lechan, atomic_get(&lechan->tx.credits)); + struct bt_l2cap_le_chan *lechan = CONTAINER_OF(pdu_ready, + struct bt_l2cap_le_chan, + _pdu_ready); - return atomic_get(&lechan->tx.credits) >= 1; -#else - return true; -#endif -} - -struct net_buf *l2cap_data_pull(struct bt_conn *conn, - size_t amount, - size_t *length) -{ - struct bt_l2cap_le_chan *lechan = get_ready_chan(conn); - - if (!lechan) { - LOG_DBG("no channel conn %p", conn); - return NULL; - } + /* For dynamic channels, we always have credits to send that segment/PDU + * as the channel is only marked "ready" when a PDU is segmented out + * from an SDU. We only do that segmentation when we know we have at + * least one credit (ie can send >= 1 PDU). + */ /* Leave the PDU buffer in the queue until we have sent all its * fragments. - * - * 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 *pdu = k_fifo_peek_head(&lechan->tx_queue); + struct net_buf *pdu = k_fifo_peek_head(&lechan->_pdu_tx_queue); - if (!pdu) { - return NULL; - } - /* __ASSERT(pdu, "signaled ready but no PDUs in the TX queue"); */ + __ASSERT(pdu, "signaled ready but no PDUs in the TX queue"); if (bt_buf_has_view(pdu)) { LOG_ERR("already have view on %p", pdu); return NULL; } - if (lechan->_pdu_remaining == 0 && !chan_has_credits(lechan)) { - /* We don't have credits to send a new K-frame PDU. Remove the - * channel from the ready-list, it will be added back later when - * we get more credits. - */ - LOG_DBG("no credits for new K-frame on %p", lechan); - lower_data_ready(lechan); - return NULL; - } - - /* Add PDU header */ - if (lechan->_pdu_remaining == 0) { - struct bt_l2cap_hdr *hdr; - uint16_t pdu_len = get_pdu_len(lechan, pdu); - - LOG_DBG("Adding L2CAP PDU header: buf %p chan %p len %zu / %zu", - pdu, lechan, pdu_len, pdu->len); - - LOG_HEXDUMP_DBG(pdu->data, pdu->len, "PDU payload"); - - hdr = net_buf_push(pdu, sizeof(*hdr)); - hdr->len = sys_cpu_to_le16(pdu_len); - hdr->cid = sys_cpu_to_le16(lechan->tx.cid); - - lechan->_pdu_remaining = pdu_len + sizeof(*hdr); - chan_take_credit(lechan); - } - - /* Whether the data to be pulled is the last ACL fragment */ - bool last_frag = amount >= lechan->_pdu_remaining; - - /* Whether the data to be pulled is part of the last L2CAP segment. For - * static channels, this variable will always be true, even though - * static channels don't have the concept of L2CAP segments. + /* 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. */ - bool last_seg = lechan->_pdu_remaining == pdu->len; + bool last_frag = amount >= pdu->len; - if (last_frag && last_seg) { - LOG_DBG("last frag of last seg, dequeuing %p", pdu); - struct net_buf *b = k_fifo_get(&lechan->tx_queue, K_NO_WAIT); + if (last_frag) { + LOG_DBG("last frag, removing %p", pdu); + struct net_buf *b = k_fifo_get(&lechan->_pdu_tx_queue, K_NO_WAIT); __ASSERT_NO_MSG(b == pdu); (void)b; - if (L2CAP_LE_CID_IS_DYN(lechan->tx.cid)) { - LOG_DBG("adding `sdu_sent` callback"); - /* No user callbacks for SDUs */ - make_closure(pdu->user_data, - l2cap_chan_sdu_sent, - UINT_TO_POINTER(lechan->tx.cid)); - } - } - - if (last_frag) { - LOG_DBG("done sending PDU"); - /* Lowering the "request to send" and raising it again allows * fair scheduling of channels on an ACL link: the channel is * marked as "ready to send" by adding a reference to it on a @@ -958,15 +881,6 @@ struct net_buf *l2cap_data_pull(struct bt_conn *conn, } } - /* This is used by `conn.c` to figure out if the PDU is done sending. */ - *length = lechan->_pdu_remaining; - - if (lechan->_pdu_remaining > amount) { - lechan->_pdu_remaining -= amount; - } else { - lechan->_pdu_remaining = 0; - } - return pdu; } @@ -1202,6 +1116,23 @@ static void l2cap_chan_rx_init(struct bt_l2cap_le_chan *chan) atomic_set(&chan->rx.credits, 1); } +static struct net_buf *l2cap_chan_le_get_tx_buf(struct bt_l2cap_le_chan *ch) +{ + struct net_buf *buf; + + /* Return current buffer */ + if (ch->tx_buf) { + buf = ch->tx_buf; + ch->tx_buf = NULL; + return buf; + } + + return net_buf_get(&ch->tx_queue, K_NO_WAIT); +} + +static int l2cap_chan_le_send_sdu(struct bt_l2cap_le_chan *ch, + struct net_buf *buf); + /** @brief Get @c chan->state. * * This field does not exist when @kconfig{CONFIG_BT_L2CAP_DYNAMIC_CHANNEL} is @@ -1218,6 +1149,49 @@ static bt_l2cap_chan_state_t bt_l2cap_chan_get_state(struct bt_l2cap_chan *chan) #endif } +static void l2cap_chan_tx_process(struct k_work *work) +{ + struct bt_l2cap_le_chan *ch; + struct net_buf *buf; + int ret; + + ch = CONTAINER_OF(k_work_delayable_from_work(work), struct bt_l2cap_le_chan, tx_work); + + LOG_DBG("%p", ch); + + if (bt_l2cap_chan_get_state(&ch->chan) != BT_L2CAP_CONNECTED) { + LOG_DBG("Cannot send on non-connected channel"); + return; + } + + /* Resume tx in case there are buffers in the queue */ + while ((buf = l2cap_chan_le_get_tx_buf(ch))) { + /* Here buf is either: + * - a partially-sent SDU le_chan->tx_buf + * - a new SDU from the TX queue + */ + LOG_DBG("chan %p buf %p", ch, buf); + + ret = l2cap_chan_le_send_sdu(ch, buf); + if (ret < 0) { + if (ret == -EAGAIN) { + /* Out of credits or buffer already locked. Work + * will be restarted upon receiving credits and + * when a segment buffer is freed. + */ + LOG_DBG("out of credits/windows"); + + ch->tx_buf = buf; + } else { + LOG_WRN("Failed to send (err %d), dropping buf %p", ret, buf); + l2cap_tx_buf_destroy(ch->chan.conn, buf, ret); + } + + return; + } + } +} + static void l2cap_chan_tx_init(struct bt_l2cap_le_chan *chan) { LOG_DBG("chan %p", chan); @@ -1225,6 +1199,8 @@ static void l2cap_chan_tx_init(struct bt_l2cap_le_chan *chan) (void)memset(&chan->tx, 0, sizeof(chan->tx)); atomic_set(&chan->tx.credits, 0); k_fifo_init(&chan->tx_queue); + k_fifo_init(&chan->_pdu_tx_queue); + k_work_init_delayable(&chan->tx_work, l2cap_chan_tx_process); } static void l2cap_chan_tx_give_credits(struct bt_l2cap_le_chan *chan, @@ -1239,9 +1215,6 @@ static void l2cap_chan_tx_give_credits(struct bt_l2cap_le_chan *chan, if (chan->chan.ops->status) { chan->chan.ops->status(&chan->chan, chan->chan.status); } - if (chan_has_data(chan)) { - raise_data_ready(chan); - } } } @@ -1267,6 +1240,16 @@ static void l2cap_chan_destroy(struct bt_l2cap_chan *chan) k_work_cancel_delayable(&le_chan->rtx_work); } + if (le_chan->tx_buf) { + l2cap_tx_buf_destroy(chan->conn, le_chan->tx_buf, -ESHUTDOWN); + le_chan->tx_buf = NULL; + } + + /* Remove buffers on the SDU TX queue */ + while ((buf = net_buf_get(&le_chan->tx_queue, K_NO_WAIT))) { + l2cap_tx_buf_destroy(chan->conn, buf, -ESHUTDOWN); + } + /* Remove buffers on the SDU RX queue */ while ((buf = net_buf_get(&le_chan->rx_queue, K_NO_WAIT))) { net_buf_unref(buf); @@ -2075,6 +2058,224 @@ static void le_disconn_rsp(struct bt_l2cap *l2cap, uint8_t ident, bt_l2cap_chan_del(&chan->chan); } +static void l2cap_chan_tx_resume(struct bt_l2cap_le_chan *ch) +{ + /* Resume sending PDUs when both conditions are met: + * - we have at least one credit + * - there is at least one SDU waiting to be sent + */ + if (!atomic_get(&ch->tx.credits) || + (k_fifo_is_empty(&ch->tx_queue) && !ch->tx_buf)) { + LOG_DBG("ch %p idle", ch); + return; + } + + k_work_reschedule(&ch->tx_work, K_NO_WAIT); +} + +static void l2cap_chan_sdu_sent(struct bt_conn *conn, void *user_data, int err) +{ + struct bt_l2cap_chan *chan; + uint16_t cid = POINTER_TO_UINT(user_data); + + LOG_DBG("conn %p CID 0x%04x err %d", conn, cid, err); + + if (err) { + LOG_DBG("error %d when sending SDU", err); + + return; + } + + chan = bt_l2cap_le_lookup_tx_cid(conn, cid); + if (!chan) { + LOG_DBG("got SDU sent cb for disconnected chan (CID %u)", cid); + + return; + } + + if (chan->ops->sent) { + chan->ops->sent(chan); + } + + /* Resume the current channel */ + l2cap_chan_tx_resume(BT_L2CAP_LE_CHAN(chan)); +} + +static void l2cap_chan_seg_sent(struct bt_conn *conn, void *user_data, int err) +{ + struct bt_l2cap_chan *chan; + uint16_t cid = POINTER_TO_UINT(user_data); + + LOG_DBG("conn %p CID 0x%04x err %d", conn, cid, err); + + if (err) { + return; + } + + chan = bt_l2cap_le_lookup_tx_cid(conn, cid); + if (!chan) { + /* Received segment sent callback for disconnected channel */ + return; + } +} + +static bool test_and_dec(atomic_t *target) +{ + atomic_t old_value, new_value; + + do { + old_value = atomic_get(target); + if (!old_value) { + return false; + } + + new_value = old_value - 1; + } while (atomic_cas(target, old_value, new_value) == 0); + + return true; +} + +/* This returns -EAGAIN whenever a segment cannot be send immediately which can + * happen under the following circuntances: + * + * 1. There are no credits + * 2. There are no buffers + * 3. There are no TX contexts + * + * In all cases the original buffer is unaffected so it can be pushed back to + * be sent later. + */ +static int l2cap_chan_le_send_seg(struct bt_l2cap_le_chan *ch, struct net_buf *buf) +{ + struct net_buf *seg; + struct net_buf_simple_state state; + int len, err; + bt_conn_tx_cb_t cb; + + if (bt_buf_has_view(buf)) { + LOG_DBG("Already have TX inflight"); + return -EAGAIN; + } + + if (!test_and_dec(&ch->tx.credits)) { + LOG_DBG("No credits to transmit packet"); + return -EAGAIN; + } + + /* Save state so it can be restored if we failed to send */ + net_buf_simple_save(&buf->b, &state); + + seg = get_seg(buf, ch->tx.mps, ch); + + CHECKIF(!seg) { + /* Future work: Give the channel a tx state + * machine, so that we remember that we took a + * credit and don't need to give it back here. + */ + LOG_WRN("Out of segment buffers."); + atomic_inc(&ch->tx.credits); + return -ENOBUFS; + } + + LOG_DBG("ch %p cid 0x%04x len %u credits %lu", ch, ch->tx.cid, seg->len, + atomic_get(&ch->tx.credits)); + + len = seg->len; + + /* SDU will be considered sent when there is no data left in the + * buffer, or if there will be no data left, if we are sending `buf` + * directly. + */ + if (buf->len == 0 || (buf == seg && buf->len == len)) { + LOG_DBG("last PDU"); + cb = l2cap_chan_sdu_sent; + } else { + LOG_DBG("send PDU left %u", buf->len); + cb = l2cap_chan_seg_sent; + } + + len = seg->len; + + /* Forward the PDU to the lower layer. + * + * Note: after this call, anything in buf->user_data should be + * considered lost, as the lower layers are free to re-use it as they + * see fit. Reading from it later is obviously a no-no. + */ + err = bt_l2cap_send_pdu(ch, seg, cb, UINT_TO_POINTER(ch->tx.cid)); + + /* The only possible error is enotconn, in that case the data will be discarded anyways */ + __ASSERT_NO_MSG(!err || err == -ENOTCONN); + + if (err) { + LOG_DBG("Unable to send seg %d", err); + atomic_inc(&ch->tx.credits); + + /* The host takes ownership of the reference in seg when + * bt_l2cap_send_pdu is successful. The call returned an error, + * so we must get rid of the reference that was taken above. + */ + LOG_DBG("unref %p (%s)", seg, + buf == seg ? "orig" : "seg"); + + if (seg == buf) { + /* move `buf` back to caller */ + } else { + net_buf_unref(seg); + } + + return err; + } + + /* Notify channel user that it can't send anymore on this channel. */ + if (!atomic_get(&ch->tx.credits)) { + LOG_DBG("chan %p paused", ch); + atomic_clear_bit(ch->chan.status, BT_L2CAP_STATUS_OUT); + + if (ch->chan.ops->status) { + ch->chan.ops->status(&ch->chan, ch->chan.status); + } + } + + return len; +} + +/** + * @param buf [move on success] + */ +static int l2cap_chan_le_send_sdu(struct bt_l2cap_le_chan *ch, + struct net_buf *buf) +{ + int ret; + size_t sent = 0; + size_t rem_len; + + __ASSERT_NO_MSG(buf); + + rem_len = buf->len; + + while (sent != rem_len) { + /* `buf` is moved only when it's full consumed. + * (ie. sent == rem_len) + */ + ret = l2cap_chan_le_send_seg(ch, buf); + if (ret < 0) { + LOG_DBG("failed to send buf (ch %p cid 0x%04x sent %d)", + ch, ch->tx.cid, sent); + + return ret; + } + + sent += ret; + } + + LOG_DBG("ch %p cid 0x%04x sent %u", ch, ch->tx.cid, sent); + + /* `l2cap_chan_le_send` moved `buf` for final seg */ + + return sent; +} + static void le_credits(struct bt_l2cap *l2cap, uint8_t ident, struct net_buf *buf) { @@ -2111,6 +2312,8 @@ static void le_credits(struct bt_l2cap *l2cap, uint8_t ident, l2cap_chan_tx_give_credits(le_chan, credits); LOG_DBG("chan %p total credits %lu", le_chan, atomic_get(&le_chan->tx.credits)); + + l2cap_chan_tx_resume(le_chan); } static void reject_cmd(struct bt_l2cap *l2cap, uint8_t ident, @@ -2227,6 +2430,12 @@ static void l2cap_chan_shutdown(struct bt_l2cap_chan *chan) le_chan->_sdu_len = 0U; } + /* Cleanup outstanding request */ + if (le_chan->tx_buf) { + l2cap_tx_buf_destroy(chan->conn, le_chan->tx_buf, -ESHUTDOWN); + le_chan->tx_buf = NULL; + } + /* Remove buffers on the TX queue */ while ((buf = net_buf_get(&le_chan->tx_queue, K_NO_WAIT))) { l2cap_tx_buf_destroy(chan->conn, buf, -ESHUTDOWN); @@ -3115,7 +3324,7 @@ static int bt_l2cap_dyn_chan_send(struct bt_l2cap_le_chan *le_chan, struct net_b net_buf_put(&le_chan->tx_queue, buf); /* Always process the queue in the same context */ - raise_data_ready(le_chan); + k_work_reschedule(&le_chan->tx_work, K_NO_WAIT); return 0; } From 2438969ae7eccf25bfcb279ae5705686aa098b20 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 216/825] Revert "[nrf fromtree] Bluetooth: host: remove TX thread" This reverts commit 11097e319941a2771a38621a3fecd12a5a9b106d. --- subsys/bluetooth/host/conn.c | 30 ++-- subsys/bluetooth/host/conn_internal.h | 3 +- subsys/bluetooth/host/hci_core.c | 166 +++++++++--------- subsys/bluetooth/host/hci_core.h | 2 - subsys/bluetooth/host/iso.c | 4 +- .../host/att/sequential/dut/src/main.c | 8 +- 6 files changed, 100 insertions(+), 113 deletions(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 4776b2e7bac..5ea212ea37a 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -52,6 +52,9 @@ LOG_MODULE_REGISTER(bt_conn); K_FIFO_DEFINE(free_tx); +void tx_processor(struct k_work *item); +K_WORK_DELAYABLE_DEFINE(tx_work, tx_processor); + static void tx_free(struct bt_conn_tx *tx); static void conn_tx_destroy(struct bt_conn *conn, struct bt_conn_tx *tx) @@ -793,6 +796,12 @@ static bool should_stop_tx(struct bt_conn *conn) return true; } +void bt_tx_irq_raise(void) +{ + LOG_DBG(""); + k_work_reschedule(&tx_work, K_NO_WAIT); +} + void bt_conn_data_ready(struct bt_conn *conn) { LOG_DBG("DR"); @@ -915,20 +924,7 @@ static void destroy_and_callback(struct bt_conn *conn, } } -static volatile bool _suspend_tx; - -#if defined(CONFIG_BT_TESTING) -void bt_conn_suspend_tx(bool suspend) -{ - _suspend_tx = suspend; - - LOG_DBG("%sing all data TX", suspend ? "suspend" : "resum"); - - bt_tx_irq_raise(); -} -#endif /* CONFIG_BT_TESTING */ - -void bt_conn_tx_processor(void) +void tx_processor(struct k_work *item) { LOG_DBG("start"); struct bt_conn *conn; @@ -941,10 +937,6 @@ void bt_conn_tx_processor(void) return; } - if (IS_ENABLED(CONFIG_BT_TESTING) && _suspend_tx) { - return; - } - conn = get_conn_ready(); if (!conn) { @@ -1019,7 +1011,7 @@ void bt_conn_tx_processor(void) /* Always kick the TX work. It will self-suspend if it doesn't get * resources or there is nothing left to send. */ - bt_tx_irq_raise(); + k_work_reschedule(&tx_work, K_NO_WAIT); } static void process_unack_tx(struct bt_conn *conn) diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index fffb0d453a2..15debcf02ab 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -541,7 +541,8 @@ void bt_conn_cleanup_all(void); /* Selects based on connection type right semaphore for ACL packets */ struct k_sem *bt_conn_get_pkts(struct bt_conn *conn); -void bt_conn_tx_processor(void); +/* k_poll related helpers for the TX thread */ +int bt_conn_prepare_events(struct k_poll_event events[]); /* To be called by upper layers when they want to send something. * Functions just like an IRQ. diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 07ffd4c849a..c9f9100f5d5 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -71,8 +71,6 @@ LOG_MODULE_REGISTER(bt_hci_core); #define BT_HCI_BUS BT_DT_HCI_BUS_GET(BT_HCI_DEV) #define BT_HCI_NAME BT_DT_HCI_NAME_GET(BT_HCI_DEV) -void bt_tx_irq_raise(void); - #define HCI_CMD_TIMEOUT K_SECONDS(10) /* Stacks for the threads */ @@ -82,6 +80,8 @@ static K_WORK_DEFINE(rx_work, rx_work_handler); static struct k_work_q bt_workq; static K_KERNEL_STACK_DEFINE(rx_thread_stack, CONFIG_BT_RX_STACK_SIZE); #endif /* CONFIG_BT_RECV_WORKQ_BT */ +static struct k_thread tx_thread_data; +static K_KERNEL_STACK_DEFINE(tx_thread_stack, CONFIG_BT_HCI_TX_STACK_SIZE); static void init_work(struct k_work *work); @@ -337,12 +337,10 @@ int bt_hci_cmd_send(uint16_t opcode, struct net_buf *buf) } net_buf_put(&bt_dev.cmd_tx_queue, buf); - bt_tx_irq_raise(); return 0; } -static bool process_pending_cmd(k_timeout_t timeout); int bt_hci_cmd_send_sync(uint16_t opcode, struct net_buf *buf, struct net_buf **rsp) { @@ -359,47 +357,21 @@ int bt_hci_cmd_send_sync(uint16_t opcode, struct net_buf *buf, LOG_DBG("buf %p opcode 0x%04x len %u", buf, opcode, buf->len); - /* This local sem is just for suspending the current thread until the - * command is processed by the LL. It is given (and we are awaken) by - * the cmd_complete/status handlers. - */ k_sem_init(&sync_sem, 0, 1); cmd(buf)->sync = &sync_sem; net_buf_put(&bt_dev.cmd_tx_queue, net_buf_ref(buf)); - bt_tx_irq_raise(); - /* TODO: disallow sending sync commands from syswq altogether */ - - /* Since the commands are now processed in the syswq, we cannot suspend - * and wait. We have to send the command from the current context. + /* Wait for a response from the Bluetooth Controller. + * The Controller may fail to respond if: + * - It was never programmed or connected. + * - There was a fatal error. + * + * See the `BT_HCI_OP_` macros in hci_types.h or + * Core_v5.4, Vol 4, Part E, Section 5.4.1 and Section 7 + * to map the opcode to the HCI command documentation. + * Example: 0x0c03 represents HCI_Reset command. */ - if (k_current_get() == &k_sys_work_q.thread) { - /* drain the command queue until we get to send the command of interest. */ - struct net_buf *cmd = NULL; - - do { - cmd = k_fifo_peek_head(&bt_dev.cmd_tx_queue); - LOG_DBG("process cmd %p want %p", cmd, buf); - - /* Wait for a response from the Bluetooth Controller. - * The Controller may fail to respond if: - * - It was never programmed or connected. - * - There was a fatal error. - * - * See the `BT_HCI_OP_` macros in hci_types.h or - * Core_v5.4, Vol 4, Part E, Section 5.4.1 and Section 7 - * to map the opcode to the HCI command documentation. - * Example: 0x0c03 represents HCI_Reset command. - */ - bool success = process_pending_cmd(HCI_CMD_TIMEOUT); - - BT_ASSERT_MSG(success, "command opcode 0x%04x timeout", opcode); - (void)success; /* cmon zephyr fix your assert macros */ - } while (buf != cmd); - } - - /* Now that we have sent the command, suspend until the LL replies */ err = k_sem_take(&sync_sem, HCI_CMD_TIMEOUT); BT_ASSERT_MSG(err == 0, "Controller unresponsive, command opcode 0x%04x timeout with err %d", @@ -2468,7 +2440,6 @@ static void hci_cmd_done(uint16_t opcode, uint8_t status, struct net_buf *evt_bu /* If the command was synchronous wake up bt_hci_cmd_send_sync() */ if (cmd(buf)->sync) { - LOG_DBG("sync cmd released"); cmd(buf)->status = status; k_sem_give(cmd(buf)->sync); } @@ -2509,7 +2480,6 @@ static void hci_cmd_complete(struct net_buf *buf) /* Allow next command to be sent */ if (ncmd) { k_sem_give(&bt_dev.ncmd_sem); - bt_tx_irq_raise(); } } @@ -2530,7 +2500,6 @@ static void hci_cmd_status(struct net_buf *buf) /* Allow next command to be sent */ if (ncmd) { k_sem_give(&bt_dev.ncmd_sem); - bt_tx_irq_raise(); } } @@ -2942,16 +2911,20 @@ static void hci_event(struct net_buf *buf) net_buf_unref(buf); } -static void hci_core_send_cmd(void) +static void send_cmd(void) { struct net_buf *buf; int err; /* Get next command */ - LOG_DBG("fetch cmd"); + LOG_DBG("calling net_buf_get"); buf = net_buf_get(&bt_dev.cmd_tx_queue, K_NO_WAIT); BT_ASSERT(buf); + /* Wait until ncmd > 0 */ + LOG_DBG("calling sem_take_wait"); + k_sem_take(&bt_dev.ncmd_sem, K_FOREVER); + /* Clear out any existing sent command */ if (bt_dev.sent_cmd) { LOG_ERR("Uncleared pending sent_cmd"); @@ -2969,7 +2942,27 @@ static void hci_core_send_cmd(void) k_sem_give(&bt_dev.ncmd_sem); hci_cmd_done(cmd(buf)->opcode, BT_HCI_ERR_UNSPECIFIED, buf); net_buf_unref(buf); - bt_tx_irq_raise(); + } +} + +static void process_events(struct k_poll_event *ev, int count) +{ + LOG_DBG("count %d", count); + + for (; count; ev++, count--) { + LOG_DBG("ev->state %u", ev->state); + + switch (ev->state) { + case K_POLL_STATE_FIFO_DATA_AVAILABLE: + if (ev->tag == BT_EVENT_CMD_TX) { + send_cmd(); + } + break; + default: + LOG_WRN("Unexpected k_poll event state %u", ev->state); + __ASSERT_NO_MSG(0); + break; + } } } @@ -2991,6 +2984,38 @@ static void hci_core_send_cmd(void) #endif /* CONFIG_BT_ISO */ #endif /* CONFIG_BT_CONN */ +static void hci_tx_thread(void *p1, void *p2, void *p3) +{ + static struct k_poll_event events[EV_COUNT] = { + K_POLL_EVENT_STATIC_INITIALIZER(K_POLL_TYPE_FIFO_DATA_AVAILABLE, + K_POLL_MODE_NOTIFY_ONLY, + &bt_dev.cmd_tx_queue, + BT_EVENT_CMD_TX), + }; + + LOG_DBG("Started"); + + while (1) { + int ev_count, err; + + events[0].state = K_POLL_STATE_NOT_READY; + ev_count = 1; + + LOG_DBG("Calling k_poll with %d events", ev_count); + + err = k_poll(events, ev_count, K_FOREVER); + BT_ASSERT(err == 0); + + process_events(events, ev_count); + + /* Make sure we don't hog the CPU if there's all the time + * some ready events. + */ + k_yield(); + } +} + + static void read_local_ver_complete(struct net_buf *buf) { struct bt_hci_rp_read_local_version_info *rp = (void *)buf->data; @@ -4200,8 +4225,7 @@ static void rx_work_handler(struct k_work *work) #if defined(CONFIG_BT_TESTING) k_tid_t bt_testing_tx_tid_get(void) { - /* We now TX everything from the syswq */ - return &k_sys_work_q.thread; + return &tx_thread_data; } #endif @@ -4253,6 +4277,13 @@ int bt_enable(bt_ready_cb_t cb) k_sem_init(&bt_dev.ncmd_sem, 0, 1); } k_fifo_init(&bt_dev.cmd_tx_queue); + /* TX thread */ + k_thread_create(&tx_thread_data, tx_thread_stack, + K_KERNEL_STACK_SIZEOF(tx_thread_stack), + hci_tx_thread, NULL, NULL, NULL, + K_PRIO_COOP(CONFIG_BT_HCI_TX_PRIO), + 0, K_NO_WAIT); + k_thread_name_set(&tx_thread_data, "BT TX"); #if defined(CONFIG_BT_RECV_WORKQ_BT) /* RX thread */ @@ -4325,6 +4356,9 @@ int bt_disable(void) disconnected_handles_reset(); #endif /* CONFIG_BT_CONN */ + /* Abort TX thread */ + k_thread_abort(&tx_thread_data); + #if defined(CONFIG_BT_RECV_WORKQ_BT) /* Abort RX thread */ k_thread_abort(&bt_workq.thread); @@ -4625,41 +4659,3 @@ int bt_configure_data_path(uint8_t dir, uint8_t id, uint8_t vs_config_len, return err; } - -/* Return `true` if a command was processed/sent */ -static bool process_pending_cmd(k_timeout_t timeout) -{ - if (!k_fifo_is_empty(&bt_dev.cmd_tx_queue)) { - if (k_sem_take(&bt_dev.ncmd_sem, K_NO_WAIT) == 0) { - hci_core_send_cmd(); - return true; - } - } - - return false; -} - -static void tx_processor(struct k_work *item) -{ - LOG_DBG("TX process start"); - if (process_pending_cmd(K_NO_WAIT)) { - /* If we processed a command, let the scheduler run before - * processing another command (or data). - */ - bt_tx_irq_raise(); - return; - } - - /* Hand over control to conn to process pending data */ - if (IS_ENABLED(CONFIG_BT_CONN_TX)) { - bt_conn_tx_processor(); - } -} - -K_WORK_DELAYABLE_DEFINE(tx_work, tx_processor); - -void bt_tx_irq_raise(void) -{ - LOG_DBG("kick TX"); - k_work_reschedule(&tx_work, K_NO_WAIT); -} diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index e9e70f4ba28..32eb5470a40 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -561,5 +561,3 @@ void bt_hci_le_df_cte_req_failed(struct net_buf *buf); void bt_hci_le_per_adv_subevent_data_request(struct net_buf *buf); void bt_hci_le_per_adv_response_report(struct net_buf *buf); - -void bt_tx_irq_raise(void); diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c index 298e7732df2..accba8a10bc 100644 --- a/subsys/bluetooth/host/iso.c +++ b/subsys/bluetooth/host/iso.c @@ -729,9 +729,9 @@ static bool iso_has_data(struct bt_conn *conn) { #if defined(CONFIG_BT_ISO_TX) return !k_fifo_is_empty(&conn->iso.txq); -#else /* !CONFIG_BT_ISO_TX */ +#else return false; -#endif /* CONFIG_BT_ISO_TX */ +#endif } static struct net_buf *iso_data_pull(struct bt_conn *conn, size_t amount) diff --git a/tests/bsim/bluetooth/host/att/sequential/dut/src/main.c b/tests/bsim/bluetooth/host/att/sequential/dut/src/main.c index 3796c83db3c..d44d172eb0c 100644 --- a/tests/bsim/bluetooth/host/att/sequential/dut/src/main.c +++ b/tests/bsim/bluetooth/host/att/sequential/dut/src/main.c @@ -32,8 +32,8 @@ static atomic_t nwrites; static atomic_t indications; static atomic_t notifications; -/* Defined in conn.c */ -extern void bt_conn_suspend_tx(bool suspend); +/* Defined in hci_core.c */ +extern k_tid_t bt_testing_tx_tid_get(void); static struct bt_conn *dconn; @@ -159,7 +159,7 @@ static ssize_t written_to(struct bt_conn *conn, if (atomic_get(&nwrites) == 0) { /* Suspend on the first write, which is an ATT Request */ LOG_INF("suspending HCI TX thread"); - bt_conn_suspend_tx(true); + k_thread_suspend(bt_testing_tx_tid_get()); } atomic_inc(&nwrites); @@ -311,7 +311,7 @@ void test_procedure_0(void) WAIT_FOR_VAL(nwrites, 3); /* Send RSP to LL */ - bt_conn_suspend_tx(false); + k_thread_resume(bt_testing_tx_tid_get()); PASS("DUT done\n"); } From dc8bdc1017bd8637d4331030a372f8283f35af01 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 217/825] Revert "[nrf fromtree] Bluetooth: L2CAP: remove CONFIG_BT_L2CAP_RESCHED_MS" This reverts commit 494da02528b8f12a41879404ddfa9f662b98ab3d. --- subsys/bluetooth/host/Kconfig.l2cap | 12 ++++++++++++ subsys/bluetooth/host/l2cap.c | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/subsys/bluetooth/host/Kconfig.l2cap b/subsys/bluetooth/host/Kconfig.l2cap index ded4d5ae2d0..94fc58b08af 100644 --- a/subsys/bluetooth/host/Kconfig.l2cap +++ b/subsys/bluetooth/host/Kconfig.l2cap @@ -44,6 +44,18 @@ config BT_L2CAP_TX_MTU help Maximum L2CAP MTU for L2CAP TX buffers. +config BT_L2CAP_RESCHED_MS + int + default 1000 + help + Delay between retries for sending L2CAP segment. Necessary because the + stack might not be able to allocate enough conn contexts and might not + have enough credits, leading to a state where an SDU is stuck + mid-transfer and never resumes. + + Note that this should seldom happen, this is just to work around a few + edge cases. + config BT_L2CAP_DYNAMIC_CHANNEL bool "L2CAP Dynamic Channel support" depends on BT_SMP diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index ad6a0d01cab..dfd0a501f02 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -1182,6 +1182,12 @@ static void l2cap_chan_tx_process(struct k_work *work) LOG_DBG("out of credits/windows"); ch->tx_buf = buf; + /* If we don't reschedule, and the app doesn't nudge l2cap (e.g. by + * sending another SDU), the channel will be stuck in limbo. To + * prevent this, we reschedule with a configurable delay. + * FIXME: is this still necessary? + */ + k_work_schedule(&ch->tx_work, K_MSEC(CONFIG_BT_L2CAP_RESCHED_MS)); } else { LOG_WRN("Failed to send (err %d), dropping buf %p", ret, buf); l2cap_tx_buf_destroy(ch->chan.conn, buf, ret); From 0222feaf0e68c2778a88ea86c73ae164e31dd12a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 218/825] Revert "[nrf fromtree] Bluetooth: L2CAP: Make `bt_l2cap_send_pdu()`" This reverts commit 282ac17d856d7a99b7d8da4ad02614f73737ff80. --- subsys/bluetooth/host/att.c | 2 +- subsys/bluetooth/host/l2cap.c | 46 ++++++++++++++------------ subsys/bluetooth/host/l2cap_internal.h | 14 +++++--- subsys/bluetooth/host/smp.c | 8 ++--- subsys/bluetooth/host/smp_null.c | 4 +-- 5 files changed, 40 insertions(+), 34 deletions(-) diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c index f883e2b12de..efa30353f0d 100644 --- a/subsys/bluetooth/host/att.c +++ b/subsys/bluetooth/host/att.c @@ -408,7 +408,7 @@ 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); + err = bt_l2cap_send(chan->att->conn, BT_L2CAP_CID_ATT, buf); if (err) { if (err == -ENOBUFS) { LOG_ERR("Ran out of TX buffers or contexts."); diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index dfd0a501f02..1598fa2e04d 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -545,10 +545,7 @@ static struct net_buf *l2cap_create_le_sig_pdu(uint8_t code, uint8_t ident, */ static int l2cap_send_sig(struct bt_conn *conn, struct net_buf *buf) { - struct bt_l2cap_chan *ch = bt_l2cap_le_lookup_tx_cid(conn, BT_L2CAP_CID_LE_SIG); - struct bt_l2cap_le_chan *chan = BT_L2CAP_LE_CHAN(ch); - - int err = bt_l2cap_send_pdu(chan, buf, NULL, NULL); + int err = bt_l2cap_send(conn, BT_L2CAP_CID_LE_SIG, buf); if (err) { net_buf_unref(buf); @@ -774,41 +771,46 @@ static void cancel_data_ready(struct bt_l2cap_le_chan *le_chan) atomic_set(&le_chan->_pdu_ready_lock, 0); } -int bt_l2cap_send_pdu(struct bt_l2cap_le_chan *le_chan, struct net_buf *pdu, - bt_conn_tx_cb_t cb, void *user_data) +int bt_l2cap_send_cb(struct bt_conn *conn, uint16_t cid, struct net_buf *seg, + bt_conn_tx_cb_t cb, void *user_data) { struct bt_l2cap_hdr *hdr; - LOG_DBG("chan %p len %zu", le_chan, pdu->len); + LOG_DBG("conn %p cid %u len %zu", conn, cid, seg->len); + + hdr = net_buf_push(seg, sizeof(*hdr)); + hdr->len = sys_cpu_to_le16(seg->len - sizeof(*hdr)); + hdr->cid = sys_cpu_to_le16(cid); + + /* TODO: un-foreach this: ATT, SMP & L2CAP CoC _know_ the channel */ + struct bt_l2cap_chan *ch = bt_l2cap_le_lookup_tx_cid(conn, cid); - hdr = net_buf_push(pdu, sizeof(*hdr)); - hdr->len = sys_cpu_to_le16(pdu->len - sizeof(*hdr)); - hdr->cid = sys_cpu_to_le16(le_chan->tx.cid); + struct bt_l2cap_le_chan *chan = CONTAINER_OF(ch, struct bt_l2cap_le_chan, chan); - if (pdu->ref != 1) { + if (seg->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 1 ref, got %d", pdu->ref); + LOG_ERR("Expecting 1 ref, got %d", seg->ref); return -EINVAL; } - if (pdu->user_data_size < sizeof(struct closure)) { + if (seg->user_data_size < sizeof(struct closure)) { LOG_DBG("not enough room in user_data %d < %d pool %u", - pdu->user_data_size, + seg->user_data_size, CONFIG_BT_CONN_TX_USER_DATA_SIZE, - pdu->pool_id); + seg->pool_id); return -EINVAL; } - make_closure(pdu->user_data, cb, user_data); + make_closure(seg->user_data, cb, user_data); LOG_DBG("push: cb %p userdata %p", cb, user_data); - net_buf_put(&le_chan->_pdu_tx_queue, pdu); + net_buf_put(&chan->_pdu_tx_queue, seg); - raise_data_ready(le_chan); /* tis just a flag */ + raise_data_ready(chan); /* tis just a flag */ return 0; /* look ma, no failures */ } @@ -2208,7 +2210,8 @@ static int l2cap_chan_le_send_seg(struct bt_l2cap_le_chan *ch, struct net_buf *b * considered lost, as the lower layers are free to re-use it as they * see fit. Reading from it later is obviously a no-no. */ - err = bt_l2cap_send_pdu(ch, seg, cb, UINT_TO_POINTER(ch->tx.cid)); + err = bt_l2cap_send_cb(ch->chan.conn, ch->tx.cid, seg, + cb, UINT_TO_POINTER(ch->tx.cid)); /* The only possible error is enotconn, in that case the data will be discarded anyways */ __ASSERT_NO_MSG(!err || err == -ENOTCONN); @@ -2218,7 +2221,7 @@ static int l2cap_chan_le_send_seg(struct bt_l2cap_le_chan *ch, struct net_buf *b atomic_inc(&ch->tx.credits); /* The host takes ownership of the reference in seg when - * bt_l2cap_send_pdu is successful. The call returned an error, + * bt_l2cap_send_cb is successful. The call returned an error, * so we must get rid of the reference that was taken above. */ LOG_DBG("unref %p (%s)", seg, @@ -3362,7 +3365,8 @@ int bt_l2cap_chan_send(struct bt_l2cap_chan *chan, struct net_buf *buf) } /* Sending over static channels is not supported by this fn. Use - * `bt_l2cap_send_pdu()` instead. + * `bt_l2cap_send()` if external to this file, or `l2cap_send` if + * internal. */ if (IS_ENABLED(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL)) { struct bt_l2cap_le_chan *le_chan = BT_L2CAP_LE_CHAN(chan); diff --git a/subsys/bluetooth/host/l2cap_internal.h b/subsys/bluetooth/host/l2cap_internal.h index ced0493515e..16ea2cf4b5c 100644 --- a/subsys/bluetooth/host/l2cap_internal.h +++ b/subsys/bluetooth/host/l2cap_internal.h @@ -214,8 +214,14 @@ struct net_buf *bt_l2cap_create_pdu_timeout(struct net_buf_pool *pool, * * Buffer ownership is transferred to stack in case of success. */ -int bt_l2cap_send_pdu(struct bt_l2cap_le_chan *le_chan, struct net_buf *pdu, - bt_conn_tx_cb_t cb, void *user_data); +int bt_l2cap_send_cb(struct bt_conn *conn, uint16_t cid, struct net_buf *buf, + bt_conn_tx_cb_t cb, void *user_data); + +static inline int bt_l2cap_send(struct bt_conn *conn, uint16_t cid, + struct net_buf *buf) +{ + return bt_l2cap_send_cb(conn, cid, buf, NULL, NULL); +} /* Receive a new L2CAP PDU from a connection */ void bt_l2cap_recv(struct bt_conn *conn, struct net_buf *buf, bool complete); @@ -248,6 +254,4 @@ void bt_l2cap_register_ecred_cb(const struct bt_l2cap_ecred_cb *cb); struct bt_l2cap_server *bt_l2cap_server_lookup_psm(uint16_t psm); /* Pull data from the L2CAP layer */ -struct net_buf *l2cap_data_pull(struct bt_conn *conn, - size_t amount, - size_t *length); +struct net_buf *l2cap_data_pull(struct bt_conn *conn, size_t amount); diff --git a/subsys/bluetooth/host/smp.c b/subsys/bluetooth/host/smp.c index 02b66587d44..5de1b5b5ed3 100644 --- a/subsys/bluetooth/host/smp.c +++ b/subsys/bluetooth/host/smp.c @@ -1750,9 +1750,7 @@ static void smp_timeout(struct k_work *work) static void smp_send(struct bt_smp *smp, struct net_buf *buf, bt_conn_tx_cb_t cb, void *user_data) { - __ASSERT_NO_MSG(user_data == NULL); - - int err = bt_l2cap_send_pdu(&smp->chan, buf, cb, NULL); + int err = bt_l2cap_send_cb(smp->chan.chan.conn, BT_L2CAP_CID_SMP, buf, cb, NULL); if (err) { if (err == -ENOBUFS) { @@ -1807,7 +1805,7 @@ static int smp_error(struct bt_smp *smp, uint8_t reason) rsp->reason = reason; /* SMP timer is not restarted for PairingFailed so don't use smp_send */ - if (bt_l2cap_send_pdu(&smp->chan, buf, NULL, NULL)) { + if (bt_l2cap_send(smp->chan.chan.conn, BT_L2CAP_CID_SMP, buf)) { net_buf_unref(buf); } @@ -2826,7 +2824,7 @@ static int smp_send_security_req(struct bt_conn *conn) req->auth_req = get_auth(smp, BT_SMP_AUTH_DEFAULT); /* SMP timer is not restarted for SecRequest so don't use smp_send */ - err = bt_l2cap_send_pdu(&smp->chan, req_buf, NULL, NULL); + err = bt_l2cap_send(conn, BT_L2CAP_CID_SMP, req_buf); if (err) { net_buf_unref(req_buf); return err; diff --git a/subsys/bluetooth/host/smp_null.c b/subsys/bluetooth/host/smp_null.c index 77774e99934..6f558bffadd 100644 --- a/subsys/bluetooth/host/smp_null.c +++ b/subsys/bluetooth/host/smp_null.c @@ -41,7 +41,7 @@ int bt_smp_sign(struct bt_conn *conn, struct net_buf *buf) static int bt_smp_recv(struct bt_l2cap_chan *chan, struct net_buf *req_buf) { - struct bt_l2cap_le_chan *le_chan = BT_L2CAP_LE_CHAN(chan); + struct bt_conn *conn = chan->conn; struct bt_smp_pairing_fail *rsp; struct bt_smp_hdr *hdr; struct net_buf *buf; @@ -63,7 +63,7 @@ static int bt_smp_recv(struct bt_l2cap_chan *chan, struct net_buf *req_buf) rsp = net_buf_add(buf, sizeof(*rsp)); rsp->reason = BT_SMP_ERR_PAIRING_NOTSUPP; - if (bt_l2cap_send_pdu(le_chan, buf, NULL, NULL)) { + if (bt_l2cap_send(conn, BT_L2CAP_CID_SMP, buf)) { net_buf_unref(buf); } From ec539050b0e2c798d1b0dcf5cbef6bfc105daf0e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 219/825] Revert "[nrf fromtree] Bluetooth: host: Change TX pattern (push -> pull)" This reverts commit 2ba216a07993c82e5ab2b4ed6cc896d2209d4b47. --- include/zephyr/bluetooth/l2cap.h | 16 +- subsys/bluetooth/host/Kconfig | 10 +- subsys/bluetooth/host/classic/l2cap_br.c | 126 +-- .../host/classic/l2cap_br_interface.h | 3 - subsys/bluetooth/host/conn.c | 814 +++++++++--------- subsys/bluetooth/host/conn_internal.h | 101 +-- subsys/bluetooth/host/hci_core.c | 55 +- subsys/bluetooth/host/hci_core.h | 4 - subsys/bluetooth/host/iso.c | 114 +-- subsys/bluetooth/host/iso_internal.h | 8 - subsys/bluetooth/host/l2cap.c | 181 +--- subsys/bluetooth/host/l2cap_internal.h | 3 - tests/bsim/bluetooth/ll/bis/src/main.c | 3 +- 13 files changed, 502 insertions(+), 936 deletions(-) diff --git a/include/zephyr/bluetooth/l2cap.h b/include/zephyr/bluetooth/l2cap.h index 4525aef6a8b..aeab4905041 100644 --- a/include/zephyr/bluetooth/l2cap.h +++ b/include/zephyr/bluetooth/l2cap.h @@ -191,7 +191,7 @@ struct bt_l2cap_le_chan { */ struct bt_l2cap_le_endpoint tx; #if defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL) - /** Channel Transmission queue (for SDUs) */ + /** Channel Transmission queue */ struct k_fifo tx_queue; /** Channel Pending Transmission buffer */ struct net_buf *tx_buf; @@ -218,13 +218,6 @@ struct bt_l2cap_le_chan { struct k_work_delayable rtx_work; struct k_work_sync rtx_sync; #endif - - /** @internal To be used with @ref bt_conn.upper_data_ready */ - sys_snode_t _pdu_ready; - /** @internal To be used with @ref bt_conn.upper_data_ready */ - atomic_t _pdu_ready_lock; - /** @internal Queue of net bufs not yet sent to lower layer */ - struct k_fifo _pdu_tx_queue; }; /** @@ -267,13 +260,6 @@ struct bt_l2cap_br_chan { /* Response Timeout eXpired (RTX) timer */ struct k_work_delayable rtx_work; struct k_work_sync rtx_sync; - - /** @internal To be used with @ref bt_conn.upper_data_ready */ - sys_snode_t _pdu_ready; - /** @internal To be used with @ref bt_conn.upper_data_ready */ - atomic_t _pdu_ready_lock; - /** @internal Queue of net bufs not yet sent to lower layer */ - struct k_fifo _pdu_tx_queue; }; /** @brief L2CAP Channel operations structure. */ diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index f9bbac130cc..281407fdcf4 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -267,8 +267,8 @@ config BT_LIM_ADV_TIMEOUT config BT_CONN_TX_USER_DATA_SIZE int - default 32 if 64BIT - default 16 + default 24 if 64BIT + default 12 help Necessary user_data size for allowing packet fragmentation when sending over HCI. See `struct tx_meta` in conn.c. @@ -285,12 +285,12 @@ if BT_CONN config BT_CONN_TX_MAX int "Maximum number of pending TX buffers with a callback" - default BT_BUF_ACL_TX_COUNT - range BT_BUF_ACL_TX_COUNT 255 + default BT_L2CAP_TX_BUF_COUNT + range BT_L2CAP_TX_BUF_COUNT 255 help Maximum number of pending TX buffers that have an associated callback. Normally this can be left to the default value, which - is equal to the number of TX buffers in the controller. + is equal to the number of TX buffers in the stack-internal pool. config BT_CONN_PARAM_ANY bool "Accept any values for connection parameters" diff --git a/subsys/bluetooth/host/classic/l2cap_br.c b/subsys/bluetooth/host/classic/l2cap_br.c index 67ab2a74feb..a1854a2489a 100644 --- a/subsys/bluetooth/host/classic/l2cap_br.c +++ b/subsys/bluetooth/host/classic/l2cap_br.c @@ -214,8 +214,6 @@ static bool l2cap_br_chan_add(struct bt_conn *conn, struct bt_l2cap_chan *chan, return false; } - k_fifo_init(&ch->_pdu_tx_queue); - /* All dynamic channels have the destroy handler which makes sure that * the RTX work structure is properly released with a cancel sync. * The fixed signal channel is only removed when disconnected and the @@ -241,71 +239,18 @@ static uint8_t l2cap_br_get_ident(void) return ident; } -static void raise_data_ready(struct bt_l2cap_br_chan *br_chan) -{ - if (!atomic_set(&br_chan->_pdu_ready_lock, 1)) { - sys_slist_append(&br_chan->chan.conn->l2cap_data_ready, - &br_chan->_pdu_ready); - LOG_DBG("data ready raised"); - } else { - LOG_DBG("data ready already"); - } - - bt_conn_data_ready(br_chan->chan.conn); -} - -static void lower_data_ready(struct bt_l2cap_br_chan *br_chan) -{ - struct bt_conn *conn = br_chan->chan.conn; - sys_snode_t *s = sys_slist_get(&conn->l2cap_data_ready); - - __ASSERT_NO_MSG(s == &br_chan->_pdu_ready); - (void)s; - - atomic_t old = atomic_set(&br_chan->_pdu_ready_lock, 0); - - __ASSERT_NO_MSG(old); - (void)old; -} - -static void cancel_data_ready(struct bt_l2cap_br_chan *br_chan) -{ - struct bt_conn *conn = br_chan->chan.conn; - - sys_slist_find_and_remove(&conn->l2cap_data_ready, - &br_chan->_pdu_ready); - - atomic_set(&br_chan->_pdu_ready_lock, 0); -} - int bt_l2cap_br_send_cb(struct bt_conn *conn, uint16_t cid, struct net_buf *buf, bt_conn_tx_cb_t cb, void *user_data) { struct bt_l2cap_hdr *hdr; - struct bt_l2cap_chan *ch = bt_l2cap_br_lookup_tx_cid(conn, cid); - struct bt_l2cap_br_chan *br_chan = CONTAINER_OF(ch, struct bt_l2cap_br_chan, chan); - LOG_DBG("chan %p buf %p len %zu", br_chan, buf, buf->len); + LOG_DBG("conn %p cid %u len %zu", conn, cid, buf->len); hdr = net_buf_push(buf, sizeof(*hdr)); hdr->len = sys_cpu_to_le16(buf->len - sizeof(*hdr)); hdr->cid = sys_cpu_to_le16(cid); - if (buf->user_data_size < sizeof(struct closure)) { - LOG_DBG("not enough room in user_data %d < %d pool %u", - buf->user_data_size, - CONFIG_BT_CONN_TX_USER_DATA_SIZE, - buf->pool_id); - return -EINVAL; - } - - LOG_DBG("push PDU: cb %p userdata %p", cb, user_data); - - make_closure(buf->user_data, cb, user_data); - net_buf_put(&br_chan->_pdu_tx_queue, buf); - raise_data_ready(br_chan); - - return 0; + return bt_conn_send_cb(conn, buf, cb, user_data); } /* Send the buffer and release it in case of failure. @@ -342,63 +287,6 @@ static void l2cap_br_chan_send_req(struct bt_l2cap_br_chan *chan, k_work_reschedule(&chan->rtx_work, timeout); } -/* L2CAP channel wants to send a PDU */ -static bool chan_has_data(struct bt_l2cap_br_chan *br_chan) -{ - return !k_fifo_is_empty(&br_chan->_pdu_tx_queue); -} - -struct net_buf *l2cap_br_data_pull(struct bt_conn *conn, size_t amount) -{ - const sys_snode_t *pdu_ready = sys_slist_peek_head(&conn->l2cap_data_ready); - - if (!pdu_ready) { - LOG_DBG("nothing to send on this conn"); - return NULL; - } - - struct bt_l2cap_br_chan *br_chan = CONTAINER_OF(pdu_ready, - struct bt_l2cap_br_chan, - _pdu_ready); - - /* Leave the PDU buffer in the queue until we have sent all its - * fragments. - */ - struct net_buf *pdu = k_fifo_peek_head(&br_chan->_pdu_tx_queue); - - __ASSERT(pdu, "signaled ready but no PDUs in the TX queue"); - - if (bt_buf_has_view(pdu)) { - LOG_ERR("already have view on %p", pdu); - return NULL; - } - - /* 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. - */ - bool last_frag = amount >= pdu->len; - - if (last_frag) { - LOG_DBG("last frag, removing %p", pdu); - struct net_buf *b = k_fifo_get(&br_chan->_pdu_tx_queue, K_NO_WAIT); - - __ASSERT_NO_MSG(b == pdu); - (void)b; - - LOG_DBG("chan %p done", br_chan); - lower_data_ready(br_chan); - - /* Append channel to list if it still has data */ - if (chan_has_data(br_chan)) { - LOG_DBG("chan %p ready", br_chan); - raise_data_ready(br_chan); - } - } - - return pdu; -} - static void l2cap_br_get_info(struct bt_l2cap_br *l2cap, uint16_t info_type) { struct bt_l2cap_info_req *info; @@ -887,7 +775,6 @@ void bt_l2cap_br_chan_set_state(struct bt_l2cap_chan *chan, void bt_l2cap_br_chan_del(struct bt_l2cap_chan *chan) { const struct bt_l2cap_chan_ops *ops = chan->ops; - struct bt_l2cap_br_chan *br_chan = CONTAINER_OF(chan, struct bt_l2cap_br_chan, chan); LOG_DBG("conn %p chan %p", chan->conn, chan); @@ -895,15 +782,6 @@ void bt_l2cap_br_chan_del(struct bt_l2cap_chan *chan) goto destroy; } - cancel_data_ready(br_chan); - - /* Remove buffers on the PDU TX queue. */ - while (chan_has_data(br_chan)) { - struct net_buf *buf = net_buf_get(&br_chan->_pdu_tx_queue, K_NO_WAIT); - - net_buf_unref(buf); - } - if (ops->disconnected) { ops->disconnected(chan); } diff --git a/subsys/bluetooth/host/classic/l2cap_br_interface.h b/subsys/bluetooth/host/classic/l2cap_br_interface.h index 340fa619694..b7978dc9bfb 100644 --- a/subsys/bluetooth/host/classic/l2cap_br_interface.h +++ b/subsys/bluetooth/host/classic/l2cap_br_interface.h @@ -46,6 +46,3 @@ void l2cap_br_encrypt_change(struct bt_conn *conn, uint8_t hci_status); /* Handle received data */ void bt_l2cap_br_recv(struct bt_conn *conn, struct net_buf *buf); - -/* Pull HCI fragments from buffers intended for `conn` */ -struct net_buf *l2cap_br_data_pull(struct bt_conn *conn, size_t amount); diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 5ea212ea37a..9c5ea4eadc5 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -50,10 +50,24 @@ #include LOG_MODULE_REGISTER(bt_conn); -K_FIFO_DEFINE(free_tx); +struct tx_meta { + bt_conn_tx_cb_t cb; + void *cb_user_data; + + /* This flag indicates if the current buffer has already been partially + * sent to the controller (ie, the next fragments should be sent as + * continuations). + */ + bool is_cont; + /* Indicates whether the ISO PDU contains a timestamp */ + bool iso_has_ts; +}; + +BUILD_ASSERT(sizeof(struct tx_meta) == CONFIG_BT_CONN_TX_USER_DATA_SIZE, + "User data size is wrong!"); -void tx_processor(struct k_work *item); -K_WORK_DELAYABLE_DEFINE(tx_work, tx_processor); +#define tx_data(buf) ((struct tx_meta *)net_buf_user_data(buf)) +K_FIFO_DEFINE(free_tx); static void tx_free(struct bt_conn_tx *tx); @@ -64,16 +78,12 @@ static void conn_tx_destroy(struct bt_conn *conn, struct bt_conn_tx *tx) bt_conn_tx_cb_t cb = tx->cb; void *user_data = tx->user_data; - LOG_DBG("conn %p tx %p cb %p ud %p", conn, tx, cb, user_data); - /* Free up TX metadata before calling callback in case the callback * tries to allocate metadata */ tx_free(tx); - if (cb) { - cb(conn, user_data, -ESHUTDOWN); - } + cb(conn, user_data, -ESHUTDOWN); } #if defined(CONFIG_BT_CONN_TX) @@ -82,8 +92,6 @@ static void tx_complete_work(struct k_work *work); static void notify_recycled_conn_slot(void); -void bt_tx_irq_raise(void); - /* Group Connected BT_CONN only in this */ #if defined(CONFIG_BT_CONN) /* Peripheral timeout to initialize Connection Parameter Update procedure */ @@ -132,18 +140,14 @@ struct frag_md *get_frag_md(struct net_buf *fragment) return &frag_md_pool[net_buf_id(fragment)]; } +void bt_tx_irq_raise(void); void frag_destroy(struct net_buf *frag) { /* allow next view to be allocated (and unlock the parent buf) */ bt_buf_destroy_view(frag, &get_frag_md(frag)->view_meta); - - LOG_DBG(""); - - /* Kick the TX processor to send the rest of the frags. */ - bt_tx_irq_raise(); } -static struct net_buf *get_data_frag(struct net_buf *outside, size_t winsize) +static struct net_buf *get_acl_frag(struct net_buf *outside, size_t winsize) { struct net_buf *window; @@ -160,22 +164,10 @@ static struct net_buf *get_data_frag(struct net_buf *outside, size_t winsize) window = bt_buf_make_view(window, net_buf_ref(outside), winsize, &get_frag_md(window)->view_meta); - LOG_DBG("get-acl-frag: outside %p window %p size %d", outside, window, winsize); + LOG_INF("get-acl-frag: outside %p window %p size %d", outside, window, winsize); return window; } -#else /* !CONFIG_BT_CONN_TX */ -static struct net_buf *get_data_frag(struct net_buf *outside, size_t winsize) -{ - ARG_UNUSED(outside); - ARG_UNUSED(winsize); - - /* This will never get called. It's only to allow compilation to take - * place and the later linker stage to remove this implementation. - */ - - return NULL; -} #endif /* CONFIG_BT_CONN_TX */ #if defined(CONFIG_BT_ISO) @@ -255,6 +247,7 @@ static void tx_free(struct bt_conn_tx *tx) LOG_DBG("%p", tx); tx->cb = NULL; tx->user_data = NULL; + tx->pending_no_cb = 0U; k_fifo_put(&free_tx, tx); } @@ -274,9 +267,8 @@ static void tx_notify(struct bt_conn *conn) key = irq_lock(); if (!sys_slist_is_empty(&conn->tx_complete)) { - const sys_snode_t *node = sys_slist_get_not_empty(&conn->tx_complete); - - tx = CONTAINER_OF(node, struct bt_conn_tx, node); + tx = CONTAINER_OF(sys_slist_get_not_empty(&conn->tx_complete), + struct bt_conn_tx, node); } irq_unlock(key); @@ -297,12 +289,7 @@ static void tx_notify(struct bt_conn *conn) * allocate new buffers since the TX should have been * unblocked by tx_free. */ - if (cb) { - cb(conn, user_data, 0); - } - - LOG_DBG("raise TX IRQ"); - bt_tx_irq_raise(); + cb(conn, user_data, 0); } } #endif /* CONFIG_BT_CONN_TX */ @@ -477,11 +464,6 @@ void bt_conn_recv(struct bt_conn *conn, struct net_buf *buf, uint8_t flags) } } -static bool dont_have_tx_context(struct bt_conn *conn) -{ - return k_fifo_is_empty(&free_tx); -} - static struct bt_conn_tx *conn_tx_alloc(void) { struct bt_conn_tx *ret = k_fifo_get(&free_tx, K_NO_WAIT); @@ -491,6 +473,70 @@ static struct bt_conn_tx *conn_tx_alloc(void) return ret; } +int bt_conn_send_iso_cb(struct bt_conn *conn, struct net_buf *buf, + bt_conn_tx_cb_t cb, bool has_ts) +{ + if (buf->user_data_size < CONFIG_BT_CONN_TX_USER_DATA_SIZE) { + LOG_ERR("not enough room in user_data %d < %d", + buf->user_data_size, + CONFIG_BT_CONN_TX_USER_DATA_SIZE); + return -EINVAL; + } + + /* Necessary for setting the TS_Flag bit when we pop the buffer from the + * send queue. The flag needs to be set before adding the buffer to the queue. + */ + tx_data(buf)->iso_has_ts = has_ts; + + int err = bt_conn_send_cb(conn, buf, cb, NULL); + + if (err) { + return err; + } + + return 0; +} + +int bt_conn_send_cb(struct bt_conn *conn, struct net_buf *buf, + bt_conn_tx_cb_t cb, void *user_data) +{ + LOG_DBG("conn handle %u buf len %u cb %p user_data %p", conn->handle, buf->len, cb, + user_data); + + if (buf->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("buf given to conn has other refs"); + return -EINVAL; + } + + if (buf->user_data_size < CONFIG_BT_CONN_TX_USER_DATA_SIZE) { + /* To find the pool: + * gdb --batch -ex 'b main' -ex 'r' -ex 'p net_buf_pool_get(pool_id)' + */ + LOG_ERR("not enough room in user_data %d < %d (pool id %u)", + buf->user_data_size, + CONFIG_BT_CONN_TX_USER_DATA_SIZE, + buf->pool_id); + return -EINVAL; + } + + if (conn->state != BT_CONN_CONNECTED) { + LOG_ERR("not connected!"); + return -ENOTCONN; + } + + tx_data(buf)->cb = cb; + tx_data(buf)->cb_user_data = user_data; + tx_data(buf)->is_cont = false; + + net_buf_put(&conn->tx_queue, buf); + return 0; +} + enum { FRAG_START, FRAG_CONT, @@ -527,7 +573,7 @@ static int send_acl(struct bt_conn *conn, struct net_buf *buf, uint8_t flags) static int send_iso(struct bt_conn *conn, struct net_buf *buf, uint8_t flags) { struct bt_hci_iso_hdr *hdr; - enum bt_iso_timestamp ts; + bool ts; switch (flags) { case FRAG_START: @@ -546,21 +592,13 @@ static int send_iso(struct bt_conn *conn, struct net_buf *buf, uint8_t flags) return -EINVAL; } - /* The TS bit is set by `iso.c:conn_iso_send`. This special byte - * prepends the whole SDU, and won't be there for individual fragments. - * - * Conveniently, it is only legal to set the TS bit on the first HCI - * fragment, so we don't have to pass this extra metadata around for - * every fragment, only the first one. - */ - if (flags == BT_ISO_SINGLE || flags == BT_ISO_START) { - ts = (enum bt_iso_timestamp)net_buf_pull_u8(buf); - } else { - ts = BT_ISO_TS_ABSENT; - } - hdr = net_buf_push(buf, sizeof(*hdr)); + + ts = tx_data(buf)->iso_has_ts && + (flags == BT_ISO_START || flags == BT_ISO_SINGLE); + hdr->handle = sys_cpu_to_le16(bt_iso_handle_pack(conn->handle, flags, ts)); + hdr->len = sys_cpu_to_le16(buf->len - sizeof(*hdr)); bt_buf_set_type(buf, BT_BUF_ISO_OUT); @@ -588,151 +626,241 @@ static inline uint16_t conn_mtu(struct bt_conn *conn) #endif /* CONFIG_BT_CONN */ } -static bool is_classic_conn(struct bt_conn *conn) +static int do_send_frag(struct bt_conn *conn, struct net_buf *buf, uint8_t flags, + struct bt_conn_tx *tx) { - return (IS_ENABLED(CONFIG_BT_CLASSIC) && - conn->type == BT_CONN_TYPE_BR); -} - -static bool is_iso_tx_conn(struct bt_conn *conn) -{ - return IS_ENABLED(CONFIG_BT_ISO_TX) && - conn->type == BT_CONN_TYPE_ISO; -} + uint32_t *pending_no_cb = NULL; + unsigned int key; + int err = 0; -static bool is_le_conn(struct bt_conn *conn) -{ - return IS_ENABLED(CONFIG_BT_CONN) && conn->type == BT_CONN_TYPE_LE; -} + LOG_DBG("conn %p buf %p len %u flags 0x%02x", conn, buf, buf->len, + flags); -static bool is_acl_conn(struct bt_conn *conn) -{ - return is_le_conn(conn) || is_classic_conn(conn); -} + /* Add to pending, it must be done before bt_buf_set_type */ + key = irq_lock(); + if (tx) { + sys_slist_append(&conn->tx_pending, &tx->node); + } else { + struct bt_conn_tx *tail_tx; -static int send_buf(struct bt_conn *conn, struct net_buf *buf, - void *cb, void *ud) -{ - struct net_buf *frag = NULL; - struct bt_conn_tx *tx = NULL; - uint8_t flags; - int err; + tail_tx = (void *)sys_slist_peek_tail(&conn->tx_pending); + if (tail_tx) { + pending_no_cb = &tail_tx->pending_no_cb; + } else { + pending_no_cb = &conn->pending_no_cb; + } - if (buf->len == 0) { - __ASSERT_NO_MSG(0); + (*pending_no_cb)++; + } + irq_unlock(key); - return -EMSGSIZE; + if (IS_ENABLED(CONFIG_BT_ISO) && conn->type == BT_CONN_TYPE_ISO) { + err = send_iso(conn, buf, flags); + } else if (IS_ENABLED(CONFIG_BT_CONN)) { + err = send_acl(conn, buf, flags); + } else { + __ASSERT(false, "Invalid connection type %u", conn->type); } - if (bt_buf_has_view(buf)) { - __ASSERT_NO_MSG(0); + if (err) { + LOG_ERR("Unable to send to driver (err %d)", err); + key = irq_lock(); + /* Roll back the pending TX info */ + if (tx) { + sys_slist_find_and_remove(&conn->tx_pending, &tx->node); + } else { + __ASSERT_NO_MSG(*pending_no_cb > 0); + (*pending_no_cb)--; + } + irq_unlock(key); - return -EIO; + /* We don't want to end up in a situation where send_acl/iso + * returns the same error code as when we don't get a buffer in + * time. + */ + err = -EIO; + goto fail; } - LOG_DBG("conn %p buf %p len %u", conn, buf, buf->len); + return 0; - /* Acquire the right to send 1 packet to the controller */ - if (k_sem_take(bt_conn_get_pkts(conn), K_NO_WAIT)) { - /* This shouldn't happen now that we acquire the resources - * before calling `send_buf` (in `get_conn_ready`). We say - * "acquire" as `tx_processor()` is not re-entrant and the - * thread is non-preemptible. So the sem value shouldn't change. +fail: + /* If we get here, something has seriously gone wrong: + * We also need to destroy the `parent` buf. + */ + k_sem_give(bt_conn_get_pkts(conn)); + if (tx) { + /* `buf` might not get destroyed, and its `tx` pointer will still be reachable. + * Make sure that we don't try to use the destroyed context later. */ - __ASSERT(0, "No controller bufs"); - - return -ENOMEM; + conn_tx_destroy(conn, tx); } - /* Allocate and set the TX context */ - tx = conn_tx_alloc(); + return err; +} - /* See big comment above */ - if (!tx) { - __ASSERT(0, "No TX context"); +static bool fits_single_ctlr_buf(struct net_buf *buf, struct bt_conn *conn) +{ + return buf->len <= conn_mtu(conn); +} - return -ENOMEM; +static int send_frag(struct bt_conn *conn, struct net_buf *buf, uint8_t flags) +{ + struct net_buf *frag; + struct bt_conn_tx *tx = NULL; + + if (bt_buf_has_view(buf)) { + LOG_ERR("already have view"); + return -EWOULDBLOCK; } - tx->cb = cb; - tx->user_data = ud; + /* Check if the controller can accept ACL packets */ + if (k_sem_take(bt_conn_get_pkts(conn), K_NO_WAIT)) { + LOG_DBG("no controller bufs"); + return -ENOBUFS; + } + + /* Check for disconnection. It can't be done higher up (ie `send_buf`) + * as `create_frag` blocks with K_FOREVER and the connection could + * change state after waiting. + */ + if (conn->state != BT_CONN_CONNECTED) { + return -ENOTCONN; + } - /* If the current buffer doesn't fit a controller buffer */ - if (buf->len > conn_mtu(conn)) { + if (!fits_single_ctlr_buf(buf, conn)) { uint16_t frag_len = MIN(conn_mtu(conn), buf->len); LOG_DBG("send frag: buf %p len %d", buf, frag_len); - /* get a view into `buf`, sized `frag_len`. Also pull - * `frag_len` bytes from `buf`. - */ - frag = get_data_frag(buf, frag_len); + /* will also do a pull */ + frag = get_acl_frag(buf, frag_len); + /* Fragments never have a TX completion callback */ + tx_data(frag)->cb = NULL; + tx_data(frag)->is_cont = false; + + int err = do_send_frag(conn, frag, flags, tx); + + if (err == -EIO) { + net_buf_unref(frag); + } + + return err; - flags = conn->next_is_frag ? FRAG_CONT : FRAG_START; - conn->next_is_frag = true; } else { - flags = conn->next_is_frag ? FRAG_END : FRAG_SINGLE; - conn->next_is_frag = false; + if (tx_data(buf)->cb) { + tx = conn_tx_alloc(); + atomic_set_bit_to(conn->flags, BT_CONN_TX_WOULDBLOCK_FREE_TX, !tx); + if (!tx) { + LOG_DBG("No available tx context"); + k_sem_give(bt_conn_get_pkts(conn)); + return -EWOULDBLOCK; + } + + tx->cb = tx_data(buf)->cb; + tx->user_data = tx_data(buf)->cb_user_data; + tx->pending_no_cb = 0U; + } + + /* De-queue the buffer now that we know we can send it. + * Only applies if the buffer to be sent is the original buffer, + * and not one of its fragments. + * This buffer was fetched from the FIFO using a peek operation. + */ + buf = net_buf_get(&conn->tx_queue, K_NO_WAIT); + frag = buf; + + return do_send_frag(conn, frag, flags, tx); } +} - /* At this point, the buffer is either a fragment or a full HCI packet. - * The flags are also valid. - */ - LOG_DBG("conn %p buf %p len %u flags 0x%02x", - conn, frag ? frag : buf, buf->len, flags); +/* Tentatively send a buffer to the HCI driver. + * + * This is designed to be async, as in most failures due to lack of resources + * are not fatal. The caller should call `send_buf()` again later. + * + * Return values: + * + * - 0: `buf` sent. `buf` ownership transferred to lower layers. + * + * - -EIO: buffer failed to send due to HCI error. `buf` ownership returned to + * caller BUT `buf` is popped from the TX queue. The caller shall destroy + * `buf` and its TX context. + * + * - Any other error: buffer failed to send. `buf` ownership returned to caller + * and `buf` is still the head of the TX queue + * + */ +static int send_buf(struct bt_conn *conn, struct net_buf *buf) +{ + uint8_t flags; + int err; - /* Keep track of sent buffers. We have to append _before_ - * sending, as we might get pre-empted if the HCI driver calls - * k_yield() before returning. - * - * In that case, the controller could also send a num-complete-packets - * event and our handler will be confused that there is no corresponding - * callback node in the `tx_pending` list. - */ - atomic_inc(&conn->in_ll); - sys_slist_append(&conn->tx_pending, &tx->node); + LOG_DBG("conn %p buf %p len %u", conn, buf, buf->len); - if (is_iso_tx_conn(conn)) { - err = send_iso(conn, frag ? frag : buf, flags); - } else if (is_acl_conn(conn)) { - err = send_acl(conn, frag ? frag : buf, flags); - } else { - err = -EINVAL; /* Some animals disable asserts (╯°□°)╯︵ ┻━┻ */ - __ASSERT(false, "Invalid connection type %u", conn->type); + if (bt_buf_has_view(buf)) { + LOG_DBG("locked by existing view"); + return -EWOULDBLOCK; } - if (!err) { - return 0; + /* Send directly if the packet fits the ACL MTU */ + if (buf->len <= conn_mtu(conn) && !tx_data(buf)->is_cont) { + LOG_DBG("send single"); + return send_frag(conn, buf, FRAG_SINGLE); } - /* Remove buf from pending list */ - atomic_dec(&conn->in_ll); - (void)sys_slist_find_and_remove(&conn->tx_pending, &tx->node); + /* + * Send the fragments. For the last one simply use the original + * buffer (which works since we've used net_buf_pull on it). + */ + flags = FRAG_START; + if (tx_data(buf)->is_cont) { + flags = FRAG_CONT; + } - LOG_ERR("Unable to send to driver (err %d)", err); + while (buf->len > conn_mtu(conn)) { + tx_data(buf)->is_cont = true; + err = send_frag(conn, buf, flags); + if (err) { + LOG_DBG("%p failed, mark as existing frag", buf); + return err; + } - /* If we get here, something has seriously gone wrong: The caller should - * also destroy the `parent` buf (of which the current fragment - * belongs). - */ - if (frag) { - net_buf_unref(frag); + flags = FRAG_CONT; } - /* `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)); + bool single = flags == FRAG_START; - /* Merge HCI driver errors */ - return -EIO; + LOG_DBG("send %s", single ? "single" : "last"); + + /* Frag is either a direct-send or the last in the series. */ + return send_frag(conn, buf, single ? FRAG_SINGLE : FRAG_END); } static struct k_poll_signal conn_change = K_POLL_SIGNAL_INITIALIZER(conn_change); +static void conn_cleanup(struct bt_conn *conn) +{ + struct net_buf *buf; + + /* Give back any allocated buffers */ + while ((buf = net_buf_get(&conn->tx_queue, K_NO_WAIT))) { + bt_conn_tx_cb_t cb = tx_data(buf)->cb; + void *cb_user_data = tx_data(buf)->cb_user_data; + + net_buf_unref(buf); + cb(conn, cb_user_data, -ESHUTDOWN); + } + + __ASSERT(sys_slist_is_empty(&conn->tx_pending), "Pending TX packets"); + __ASSERT_NO_MSG(conn->pending_no_cb == 0); + + bt_conn_reset_rx_state(conn); + + k_work_reschedule(&conn->deferred_work, K_NO_WAIT); +} + static void conn_destroy(struct bt_conn *conn, void *data) { if (conn->state == BT_CONN_CONNECTED || @@ -750,288 +878,184 @@ void bt_conn_cleanup_all(void) bt_conn_foreach(BT_CONN_TYPE_ALL, conn_destroy, NULL); } -#if defined(CONFIG_BT_CONN) -/* Returns true if L2CAP has data to send on this conn */ -static bool acl_has_data(struct bt_conn *conn) -{ - return sys_slist_peek_head(&conn->l2cap_data_ready) != NULL; -} -#endif /* defined(CONFIG_BT_CONN) */ - -/* Connection "Scheduler" of sorts: - * - * Will try to get the optimal number of queued buffers for the connection. - * - * Partitions the controller's buffers to each connection according to some - * heuristic. This is made to be tunable, fairness, simplicity, throughput etc. - * - * In the future, this will be a hook exposed to the application. - */ -static bool should_stop_tx(struct bt_conn *conn) +static int conn_prepare_events(struct bt_conn *conn, + struct k_poll_event *events) { - LOG_DBG("%p", conn); - - /* TODO: This function should be overridable by the application: they - * should be able to provide their own heuristic. - */ - if (!conn->has_data(conn)) { - LOG_DBG("No more data for %p", conn); - return true; + if (!atomic_get(&conn->ref)) { + return -ENOTCONN; } - /* Queue only 3 buffers per-conn for now */ - if (atomic_get(&conn->in_ll) < 3) { - /* The goal of this heuristic is to allow the link-layer to - * extend an ACL connection event as long as the application - * layer can provide data. - * - * Here we chose three buffers, as some LLs need two enqueued - * packets to be able to set the more-data bit, and one more - * buffer to allow refilling by the app while one of them is - * being sent over-the-air. - */ - return false; + if (conn->state == BT_CONN_DISCONNECTED && + atomic_test_and_clear_bit(conn->flags, BT_CONN_CLEANUP)) { + conn_cleanup(conn); + return -ENOTCONN; } - return true; -} - -void bt_tx_irq_raise(void) -{ - LOG_DBG(""); - k_work_reschedule(&tx_work, K_NO_WAIT); -} - -void bt_conn_data_ready(struct bt_conn *conn) -{ - LOG_DBG("DR"); - - /* The TX processor will call the `pull_cb` to get the buf */ - if (!atomic_set(&conn->_conn_ready_lock, 1)) { - sys_slist_append(&bt_dev.le.conn_ready, - &conn->_conn_ready); - LOG_DBG("raised"); - } else { - LOG_DBG("already in list"); + if (conn->state != BT_CONN_CONNECTED) { + return -ENOTCONN; } - /* Kick the TX processor */ - bt_tx_irq_raise(); -} + LOG_DBG("Adding conn %p to poll list", conn); -static bool cannot_send_to_controller(struct bt_conn *conn) -{ - return k_sem_count_get(bt_conn_get_pkts(conn)) == 0; -} - -static bool dont_have_methods(struct bt_conn *conn) -{ - return (conn->tx_data_pull == NULL) || - (conn->get_and_clear_cb == NULL) || - (conn->has_data == NULL); -} - -struct bt_conn *get_conn_ready(void) -{ - /* Here we only peek: we pop the conn (and insert it at the back if it - * still has data) after the QoS function returns false. + /* ISO Synchronized Receiver only builds do not transmit and hence + * may not have any tx buffers allocated in a Controller. */ - sys_snode_t *node = sys_slist_peek_head(&bt_dev.le.conn_ready); + struct k_sem *conn_pkts = bt_conn_get_pkts(conn); - if (node == NULL) { - return NULL; + if (!conn_pkts) { + return -ENOTCONN; } - struct bt_conn *conn = CONTAINER_OF(node, struct bt_conn, _conn_ready); - - if (cannot_send_to_controller(conn)) { - /* We will get scheduled again when the buffers are freed. */ - LOG_DBG("no LL bufs for %p", conn); - return NULL; - } + bool buffers_available = k_sem_count_get(conn_pkts) > 0; + bool packets_waiting = !k_fifo_is_empty(&conn->tx_queue); - if (dont_have_tx_context(conn)) { - /* We will get scheduled again when TX contexts are available. */ - LOG_DBG("no TX contexts"); - return NULL; + if (packets_waiting && !buffers_available) { + /* Only resume sending when the controller has buffer space + * available for this connection. + */ + LOG_DBG("wait on ctlr buffers"); + k_poll_event_init(&events[0], + K_POLL_TYPE_SEM_AVAILABLE, + K_POLL_MODE_NOTIFY_ONLY, + conn_pkts); + } else if (atomic_test_bit(conn->flags, BT_CONN_TX_WOULDBLOCK_FREE_TX) && + k_fifo_is_empty(&free_tx)) { + LOG_DBG("wait on tx contexts"); + k_poll_event_init(&events[0], + K_POLL_TYPE_FIFO_DATA_AVAILABLE, + K_POLL_MODE_NOTIFY_ONLY, + &free_tx); + events[0].tag = BT_EVENT_CONN_FREE_TX; + } else { + /* This must be the last thing to be waited on, since + * only this event triggers processing. + */ + /* Wait until there is more data to send. */ + LOG_DBG("wait on host fifo"); + k_poll_event_init(&events[0], + K_POLL_TYPE_FIFO_DATA_AVAILABLE, + K_POLL_MODE_NOTIFY_ONLY, + &conn->tx_queue); + events[0].tag = BT_EVENT_CONN_TX_QUEUE; } - CHECKIF(dont_have_methods(conn)) { - LOG_DBG("conn %p (type %d) is missing mandatory methods", - conn, conn->type); + return 0; +} - return NULL; - } +int bt_conn_prepare_events(struct k_poll_event events[]) +{ + int i, ev_count = 0; + struct bt_conn *conn; - if (should_stop_tx(conn)) { - sys_snode_t *s = sys_slist_get(&bt_dev.le.conn_ready); + LOG_DBG(""); - __ASSERT_NO_MSG(s == node); - (void)s; + k_poll_signal_init(&conn_change); - atomic_t old = atomic_set(&conn->_conn_ready_lock, 0); - /* Note: we can't assert `old` is non-NULL here, as the - * connection might have been marked ready by an l2cap channel - * that cancelled its request to send. - */ + k_poll_event_init(&events[ev_count++], K_POLL_TYPE_SIGNAL, + K_POLL_MODE_NOTIFY_ONLY, &conn_change); - (void)old; +#if defined(CONFIG_BT_CONN) + for (i = 0; i < ARRAY_SIZE(acl_conns); i++) { + conn = &acl_conns[i]; - /* 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); + if (!conn_prepare_events(conn, &events[ev_count])) { + ev_count++; } } +#endif /* CONFIG_BT_CONN */ - return conn; -} - -/* Crazy that this file is compiled even if this is not true, but here we are. */ -#if defined(CONFIG_BT_CONN) -static void acl_get_and_clear_cb(struct bt_conn *conn, struct net_buf *buf, - bt_conn_tx_cb_t *cb, void **ud) -{ - __ASSERT_NO_MSG(is_acl_conn(conn)); - - *cb = closure_cb(buf->user_data); - *ud = closure_data(buf->user_data); - memset(buf->user_data, 0, buf->user_data_size); -} -#endif /* defined(CONFIG_BT_CONN) */ +#if defined(CONFIG_BT_ISO) + for (i = 0; i < ARRAY_SIZE(iso_conns); i++) { + conn = &iso_conns[i]; -/* 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); + if (!conn_prepare_events(conn, &events[ev_count])) { + ev_count++; + } } +#endif - 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); - } + return ev_count; } -void tx_processor(struct k_work *item) +void bt_conn_process_tx(struct bt_conn *conn) { - LOG_DBG("start"); - struct bt_conn *conn; struct net_buf *buf; - bt_conn_tx_cb_t cb = NULL; - void *ud = NULL; - - if (!IS_ENABLED(CONFIG_BT_CONN_TX)) { - /* Mom, can we have a real compiler? */ - return; - } - - conn = get_conn_ready(); - - if (!conn) { - LOG_DBG("no connection wants to do stuff"); - return; - } + int err; - LOG_DBG("processing conn %p", conn); + LOG_DBG("conn %p", conn); - if (conn->state != BT_CONN_CONNECTED) { - LOG_ERR("conn %p: not connected", conn); - /* Call the user callbacks & destroy (final-unref) the buffers - * we were supposed to send. - */ - buf = conn->tx_data_pull(conn, conn_mtu(conn)); - while (buf) { - destroy_and_callback(conn, buf, cb, ud); - buf = conn->tx_data_pull(conn, conn_mtu(conn)); - } + if (conn->state == BT_CONN_DISCONNECTED && + atomic_test_and_clear_bit(conn->flags, BT_CONN_CLEANUP)) { + LOG_DBG("handle %u disconnected - cleaning up", conn->handle); + conn_cleanup(conn); return; } - /* now that we are guaranteed resources, we can pull data from the upper - * layer (L2CAP or ISO). + /* Get next ACL packet for connection. The buffer will only get dequeued + * if there is a free controller buffer to put it in. + * + * Important: no operations should be done on `buf` until it is properly + * dequeued from the FIFO, using the `net_buf_get()` API. */ - buf = conn->tx_data_pull(conn, conn_mtu(conn)); - if (!buf) { - /* Either there is no more data, or the buffer is already in-use - * by a view on it. In both cases, the TX processor will be - * triggered again, either by the view's destroy callback, or by - * the upper layer when it has more data. - */ - LOG_DBG("no buf returned"); - return; - } - - bool last_buf = conn_mtu(conn) >= buf->len; - - if (last_buf) { - /* Only pull the callback info from the last buffer. - * We still allocate one TX context per-fragment though. - */ - conn->get_and_clear_cb(conn, buf, &cb, &ud); - LOG_DBG("pop: cb %p userdata %p", cb, ud); - } - - LOG_DBG("TX process: conn %p buf %p (%s)", - conn, buf, last_buf ? "last" : "frag"); + buf = k_fifo_peek_head(&conn->tx_queue); + BT_ASSERT(buf); - int err = send_buf(conn, buf, cb, ud); + /* Since we used `peek`, the queue still owns the reference to the + * buffer, so we need to take an explicit additional reference here. + */ + buf = net_buf_ref(buf); + err = send_buf(conn, buf); + net_buf_unref(buf); - 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); + /* HCI driver error. `buf` may have been popped from `tx_queue` and + * should be destroyed. + * + * TODO: In that case we might want to disable Bluetooth or at the very + * least tear down the connection. + */ + if (err == -EIO) { + bt_conn_tx_cb_t cb = tx_data(buf)->cb; + void *cb_user_data = tx_data(buf)->cb_user_data; - return; + /* destroy the buffer */ + net_buf_unref(buf); + cb(conn, cb_user_data, -ESHUTDOWN); } - - /* Always kick the TX work. It will self-suspend if it doesn't get - * resources or there is nothing left to send. - */ - k_work_reschedule(&tx_work, K_NO_WAIT); } static void process_unack_tx(struct bt_conn *conn) { - LOG_DBG("%p", conn); - /* Return any unacknowledged packets */ while (1) { struct bt_conn_tx *tx; sys_snode_t *node; + unsigned int key; + + key = irq_lock(); + + if (conn->pending_no_cb) { + conn->pending_no_cb--; + irq_unlock(key); + k_sem_give(bt_conn_get_pkts(conn)); + continue; + } node = sys_slist_get(&conn->tx_pending); + irq_unlock(key); if (!node) { - return; + break; } tx = CONTAINER_OF(node, struct bt_conn_tx, node); + key = irq_lock(); + conn->pending_no_cb = tx->pending_no_cb; + tx->pending_no_cb = 0U; + irq_unlock(key); + conn_tx_destroy(conn, tx); + k_sem_give(bt_conn_get_pkts(conn)); } } @@ -1109,6 +1133,7 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state) } break; } + k_fifo_init(&conn->tx_queue); k_poll_signal_raise(&conn_change, 0); if (IS_ENABLED(CONFIG_BT_ISO) && @@ -1161,9 +1186,8 @@ void bt_conn_set_state(struct bt_conn *conn, bt_conn_state_t state) k_work_cancel_delayable(&conn->deferred_work); } - LOG_DBG("trigger disconnect work"); - k_work_reschedule(&conn->deferred_work, K_NO_WAIT); - + atomic_set_bit(conn->flags, BT_CONN_CLEANUP); + k_poll_signal_raise(&conn_change, 0); /* The last ref will be dropped during cleanup */ break; case BT_CONN_INITIATING: @@ -1533,8 +1557,6 @@ static void tx_complete_work(struct k_work *work) struct bt_conn *conn = CONTAINER_OF(work, struct bt_conn, tx_complete_work); - LOG_DBG("conn %p", conn); - tx_notify(conn); } #endif /* CONFIG_BT_CONN_TX */ @@ -1558,18 +1580,6 @@ static void notify_recycled_conn_slot(void) #endif } -#if !defined(CONFIG_BT_CONN) -int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason) -{ - ARG_UNUSED(conn); - ARG_UNUSED(reason); - - /* Dummy implementation to satisfy the compiler */ - - return 0; -} -#endif /* !CONFIG_BT_CONN */ - /* Group Connected BT_CONN only in this */ #if defined(CONFIG_BT_CONN) @@ -2204,9 +2214,6 @@ struct bt_conn *bt_conn_add_br(const bt_addr_t *peer) bt_addr_copy(&conn->br.dst, peer); conn->type = BT_CONN_TYPE_BR; - conn->tx_data_pull = l2cap_br_data_pull; - conn->get_and_clear_cb = acl_get_and_clear_cb; - conn->has_data = acl_has_data; return conn; } @@ -2537,9 +2544,6 @@ struct bt_conn *bt_conn_add_le(uint8_t id, const bt_addr_le_t *peer) conn->required_sec_level = BT_SECURITY_L1; #endif /* CONFIG_BT_SMP */ conn->type = BT_CONN_TYPE_LE; - conn->tx_data_pull = l2cap_data_pull; - conn->get_and_clear_cb = acl_get_and_clear_cb; - conn->has_data = acl_has_data; conn->le.interval_min = BT_GAP_INIT_CONN_INT_MIN; conn->le.interval_max = BT_GAP_INIT_CONN_INT_MAX; diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index 15debcf02ab..5a3f4789f03 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -80,6 +80,8 @@ enum { BT_CONN_CTE_REQ_ENABLED, /* CTE request procedure is enabled */ BT_CONN_CTE_RSP_ENABLED, /* CTE response procedure is enabled */ + BT_CONN_TX_WOULDBLOCK_FREE_TX, /** #bt_conn_process_tx wouldblock on #free_tx */ + /* Total number of flags - must be at the end of the enum */ BT_CONN_NUM_FLAGS, }; @@ -168,9 +170,6 @@ struct bt_conn_iso { /** Stored information about the ISO stream */ struct bt_iso_info info; - - /** Queue from which conn will pull data */ - struct k_fifo txq; }; typedef void (*bt_conn_tx_cb_t)(struct bt_conn *conn, void *user_data, int err); @@ -180,6 +179,9 @@ struct bt_conn_tx { bt_conn_tx_cb_t cb; void *user_data; + + /* Number of pending packets without a callback after this one */ + uint32_t pending_no_cb; }; struct acl_data { @@ -225,8 +227,12 @@ struct bt_conn { uint16_t rx_len; struct net_buf *rx; - /* Pending TX that are awaiting the NCP event. len(tx_pending) == in_ll */ + /* Sent but not acknowledged TX packets with a callback */ sys_slist_t tx_pending; + /* Sent but not acknowledged TX packets without a callback before + * the next packet (if any) in tx_pending. + */ + uint32_t pending_no_cb; /* Completed TX for which we need to call the callback */ sys_slist_t tx_complete; @@ -234,6 +240,9 @@ struct bt_conn { struct k_work tx_complete_work; #endif /* CONFIG_BT_CONN_TX */ + /* Queue for outgoing ACL data */ + struct k_fifo tx_queue; + /* Active L2CAP channels */ sys_slist_t channels; @@ -262,85 +271,12 @@ struct bt_conn { uint16_t subversion; } rv; #endif - - /* Callback into the higher-layers (L2CAP / ISO) to return a buffer for - * sending `amount` of bytes to HCI. - * - * Scheduling from which channel to pull (e.g. for L2CAP) is done at the - * upper layer's discretion. - */ - struct net_buf * (*tx_data_pull)(struct bt_conn *conn, size_t amount); - - /* Get (and clears for ACL conns) callback and user-data for `buf`. */ - void (*get_and_clear_cb)(struct bt_conn *conn, struct net_buf *buf, - bt_conn_tx_cb_t *cb, void **ud); - - /* Return true if upper layer has data to send over HCI */ - bool (*has_data)(struct bt_conn *conn); - - /* For ACL: List of data-ready L2 channels. Used by TX processor for - * pulling HCI fragments. Channels are only ever removed from this list - * when a whole PDU (ie all its frags) have been sent. - */ - sys_slist_t l2cap_data_ready; - - /* Node for putting this connection in a data-ready mode for the bt_dev. - * This will be used by the TX processor to then fetch HCI frags from it. - */ - sys_snode_t _conn_ready; - atomic_t _conn_ready_lock; - - /* Holds the number of packets that have been sent to the controller but - * not yet ACKd (by receiving an Number of Completed Packets). This - * variable can be used for deriving a QoS or waterlevel scheme in order - * to maximize throughput/latency. - * It's an optimization so we don't chase `tx_pending` all the time. - */ - atomic_t in_ll; - - /* Next buffer should be an ACL/ISO HCI fragment */ - bool next_is_frag; - /* Must be at the end so that everything else in the structure can be * memset to zero without affecting the ref. */ atomic_t ref; }; -/* Holds the callback and a user-data field for the upper layer. This callback - * shall be called when the buffer is ACK'd by the controller (by a Num Complete - * Packets event) or if the connection dies. - * - * Flow control in the spec be crazy, look it up. LL is allowed to choose - * between sending NCP events always or not at all on disconnect. - * - * We pack the struct to make sure it fits in the net_buf user_data field. - */ -struct closure { - void *cb; - void *data; -} __packed; - -#if defined(CONFIG_BT_CONN_TX_USER_DATA_SIZE) -BUILD_ASSERT(sizeof(struct closure) < CONFIG_BT_CONN_TX_USER_DATA_SIZE); -#endif - -static inline void make_closure(void *storage, void *cb, void *data) -{ - ((struct closure *)storage)->cb = cb; - ((struct closure *)storage)->data = data; -} - -static inline void *closure_cb(void *storage) -{ - return ((struct closure *)storage)->cb; -} - -static inline void *closure_data(void *storage) -{ - return ((struct closure *)storage)->data; -} - void bt_conn_reset_rx_state(struct bt_conn *conn); /* Process incoming data for a connection */ @@ -365,6 +301,11 @@ int bt_conn_send_cb(struct bt_conn *conn, struct net_buf *buf, int bt_conn_send_iso_cb(struct bt_conn *conn, struct net_buf *buf, bt_conn_tx_cb_t cb, bool has_ts); +static inline int bt_conn_send(struct bt_conn *conn, struct net_buf *buf) +{ + return bt_conn_send_cb(conn, buf, NULL, NULL); +} + /* Check if a connection object with the peer already exists */ bool bt_conn_exists_le(uint8_t id, const bt_addr_le_t *peer); @@ -543,8 +484,4 @@ struct k_sem *bt_conn_get_pkts(struct bt_conn *conn); /* k_poll related helpers for the TX thread */ int bt_conn_prepare_events(struct k_poll_event events[]); - -/* To be called by upper layers when they want to send something. - * Functions just like an IRQ. - */ -void bt_conn_data_ready(struct bt_conn *conn); +void bt_conn_process_tx(struct bt_conn *conn); diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index c9f9100f5d5..67511d1642b 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -528,29 +528,37 @@ static void hci_num_completed_packets(struct net_buf *buf) } while (count--) { + struct bt_conn_tx *tx; sys_snode_t *node; + unsigned int key; - k_sem_give(bt_conn_get_pkts(conn)); + key = irq_lock(); + + if (conn->pending_no_cb) { + conn->pending_no_cb--; + irq_unlock(key); + k_sem_give(bt_conn_get_pkts(conn)); + continue; + } - /* move the next TX context from the `pending` list to - * the `complete` list. - */ node = sys_slist_get(&conn->tx_pending); + irq_unlock(key); if (!node) { LOG_ERR("packets count mismatch"); - __ASSERT_NO_MSG(0); break; } - sys_slist_append(&conn->tx_complete, node); + tx = CONTAINER_OF(node, struct bt_conn_tx, node); - /* align the `pending` value */ - __ASSERT_NO_MSG(atomic_get(&conn->in_ll)); - atomic_dec(&conn->in_ll); + key = irq_lock(); + conn->pending_no_cb = tx->pending_no_cb; + tx->pending_no_cb = 0U; + sys_slist_append(&conn->tx_complete, &tx->node); + irq_unlock(key); - /* TX context free + callback happens in there */ k_work_submit(&conn->tx_complete_work); + k_sem_give(bt_conn_get_pkts(conn)); } bt_conn_unref(conn); @@ -2953,14 +2961,34 @@ static void process_events(struct k_poll_event *ev, int count) LOG_DBG("ev->state %u", ev->state); switch (ev->state) { + case K_POLL_STATE_SIGNALED: + break; + case K_POLL_STATE_SEM_AVAILABLE: + /* After this fn is exec'd, `bt_conn_prepare_events()` + * will be called once again, and this time buffers will + * be available, so the FIFO will be added to the poll + * list instead of the ctlr buffers semaphore. + */ + break; case K_POLL_STATE_FIFO_DATA_AVAILABLE: if (ev->tag == BT_EVENT_CMD_TX) { send_cmd(); + } else if (IS_ENABLED(CONFIG_BT_CONN) || + IS_ENABLED(CONFIG_BT_ISO)) { + struct bt_conn *conn; + + if (ev->tag == BT_EVENT_CONN_TX_QUEUE) { + conn = CONTAINER_OF(ev->fifo, + struct bt_conn, + tx_queue); + bt_conn_process_tx(conn); + } } break; + case K_POLL_STATE_NOT_READY: + break; default: LOG_WRN("Unexpected k_poll event state %u", ev->state); - __ASSERT_NO_MSG(0); break; } } @@ -3001,6 +3029,11 @@ static void hci_tx_thread(void *p1, void *p2, void *p3) events[0].state = K_POLL_STATE_NOT_READY; ev_count = 1; + /* This adds the FIFO per-connection */ + if (IS_ENABLED(CONFIG_BT_CONN) || IS_ENABLED(CONFIG_BT_ISO)) { + ev_count += bt_conn_prepare_events(&events[1]); + } + LOG_DBG("Calling k_poll with %d events", ev_count); err = k_poll(events, ev_count, K_FOREVER); diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index 32eb5470a40..147d90794eb 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -300,10 +300,6 @@ struct bt_dev_le { */ uint8_t rl_entries; #endif /* CONFIG_BT_SMP */ - /* List of `struct bt_conn` that have either pending data to send, or - * something to process (e.g. a disconnection event). - */ - sys_slist_t conn_ready; }; #if defined(CONFIG_BT_CLASSIC) diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c index accba8a10bc..22e3466ad33 100644 --- a/subsys/bluetooth/host/iso.c +++ b/subsys/bluetooth/host/iso.c @@ -16,7 +16,6 @@ #include #include -#include "host/buf_view.h" #include "host/hci_core.h" #include "host/conn_internal.h" #include "iso_internal.h" @@ -76,9 +75,9 @@ struct bt_iso_big bigs[CONFIG_BT_ISO_MAX_BIG]; static struct bt_iso_big *lookup_big_by_handle(uint8_t big_handle); #endif /* CONFIG_BT_ISO_BROADCAST */ -static void bt_iso_sent_cb(struct bt_conn *iso, void *user_data, int err) -{ #if defined(CONFIG_BT_ISO_TX) +static void bt_iso_send_cb(struct bt_conn *iso, void *user_data, int err) +{ struct bt_iso_chan *chan = iso->iso.chan; struct bt_iso_chan_ops *ops; @@ -89,8 +88,8 @@ static void bt_iso_sent_cb(struct bt_conn *iso, void *user_data, int err) if (!err && ops != NULL && ops->sent != NULL) { ops->sent(chan); } -#endif /* CONFIG_BT_ISO_TX */ } +#endif /* CONFIG_BT_ISO_TX */ void hci_iso(struct net_buf *buf) { @@ -137,33 +136,12 @@ void hci_iso(struct net_buf *buf) bt_conn_unref(iso); } -/* Pull data from the ISO layer */ -static struct net_buf *iso_data_pull(struct bt_conn *conn, size_t amount); - -/* Returns true if the ISO layer has data to send on this conn */ -static bool iso_has_data(struct bt_conn *conn); - -static void iso_get_and_clear_cb(struct bt_conn *conn, struct net_buf *buf, - bt_conn_tx_cb_t *cb, void **ud) -{ - if (IS_ENABLED(CONFIG_BT_ISO_TX)) { - *cb = bt_iso_sent_cb; - } else { - *cb = NULL; - } - - *ud = NULL; -} - static struct bt_conn *iso_new(void) { struct bt_conn *iso = bt_conn_new(iso_conns, ARRAY_SIZE(iso_conns)); if (iso) { iso->type = BT_CONN_TYPE_ISO; - iso->tx_data_pull = iso_data_pull; - iso->get_and_clear_cb = iso_get_and_clear_cb; - iso->has_data = iso_has_data; } else { LOG_DBG("Could not create new ISO"); } @@ -252,7 +230,6 @@ static void bt_iso_chan_add(struct bt_conn *iso, struct bt_iso_chan *chan) /* Attach ISO channel to the connection */ chan->iso = iso; iso->iso.chan = chan; - k_fifo_init(&iso->iso.txq); LOG_DBG("iso %p chan %p", iso, chan); } @@ -725,61 +702,6 @@ void bt_iso_recv(struct bt_conn *iso, struct net_buf *buf, uint8_t flags) } #endif /* CONFIG_BT_ISO_RX */ -static bool iso_has_data(struct bt_conn *conn) -{ -#if defined(CONFIG_BT_ISO_TX) - return !k_fifo_is_empty(&conn->iso.txq); -#else - return false; -#endif -} - -static struct net_buf *iso_data_pull(struct bt_conn *conn, size_t amount) -{ -#if defined(CONFIG_BT_ISO_TX) - LOG_DBG("conn %p amount %d", conn, amount); - - /* Leave the PDU buffer in the queue until we have sent all its - * fragments. - */ - struct net_buf *frag = k_fifo_peek_head(&conn->iso.txq); - - if (!frag) { - LOG_DBG("signaled ready but no frag available"); - return NULL; - } - - if (conn->iso.chan->state != BT_ISO_STATE_CONNECTED) { - LOG_DBG("channel has been disconnected"); - struct net_buf *b = k_fifo_get(&conn->iso.txq, K_NO_WAIT); - (void)b; - __ASSERT_NO_MSG(b == frag); - return NULL; - } - - if (bt_buf_has_view(frag)) { - /* This should not happen. conn.c should wait until the view is - * destroyed before requesting more data. - */ - LOG_DBG("already have view"); - return NULL; - } - - bool last_frag = amount >= frag->len; - - if (last_frag) { - LOG_DBG("last frag, pop buf"); - struct net_buf *b = k_fifo_get(&conn->iso.txq, K_NO_WAIT); - (void)b; - __ASSERT_NO_MSG(b == frag); - } - - return frag; -#else - return NULL; -#endif -} - #if defined(CONFIG_BT_ISO_TX) static uint16_t iso_chan_max_data_len(const struct bt_iso_chan *chan) { @@ -801,30 +723,6 @@ static uint16_t iso_chan_max_data_len(const struct bt_iso_chan *chan) return max_data_len; } -int conn_iso_send(struct bt_conn *conn, struct net_buf *buf, enum bt_iso_timestamp has_ts) -{ - if (buf->user_data_size < CONFIG_BT_CONN_TX_USER_DATA_SIZE) { - LOG_ERR("not enough room in user_data %d < %d pool %u", - buf->user_data_size, - CONFIG_BT_CONN_TX_USER_DATA_SIZE, - buf->pool_id); - return -EINVAL; - } - - /* push the TS flag on the buffer itself. - * It will be popped and read back by conn before adding the ISO HCI header. - */ - net_buf_push_u8(buf, has_ts); - - net_buf_put(&conn->iso.txq, buf); - LOG_DBG("%p put on list", buf); - - /* only one ISO channel per conn-object */ - bt_conn_data_ready(conn); - - return 0; -} - static int validate_send(const struct bt_iso_chan *chan, const struct net_buf *buf, uint8_t hdr_size) { @@ -885,8 +783,7 @@ int bt_iso_chan_send(struct bt_iso_chan *chan, struct net_buf *buf, uint16_t seq iso_conn = chan->iso; - LOG_DBG("send-iso (no ts)"); - return conn_iso_send(iso_conn, buf, BT_ISO_TS_ABSENT); + return bt_conn_send_iso_cb(iso_conn, buf, bt_iso_send_cb, false); } int bt_iso_chan_send_ts(struct bt_iso_chan *chan, struct net_buf *buf, uint16_t seq_num, @@ -911,8 +808,7 @@ int bt_iso_chan_send_ts(struct bt_iso_chan *chan, struct net_buf *buf, uint16_t iso_conn = chan->iso; - LOG_DBG("send-iso (ts)"); - return conn_iso_send(iso_conn, buf, BT_ISO_TS_PRESENT); + return bt_conn_send_iso_cb(iso_conn, buf, bt_iso_send_cb, true); } #if defined(CONFIG_BT_ISO_CENTRAL) || defined(CONFIG_BT_ISO_BROADCASTER) diff --git a/subsys/bluetooth/host/iso_internal.h b/subsys/bluetooth/host/iso_internal.h index 44ffeb348ad..7a37413e7f3 100644 --- a/subsys/bluetooth/host/iso_internal.h +++ b/subsys/bluetooth/host/iso_internal.h @@ -158,11 +158,3 @@ void bt_iso_chan_set_state(struct bt_iso_chan *chan, enum bt_iso_state state); /* Process incoming data for a connection */ void bt_iso_recv(struct bt_conn *iso, struct net_buf *buf, uint8_t flags); - -/* Whether the HCI ISO data packet contains a timestamp or not. - * Per spec, the TS flag can only be set for the first fragment. - */ -enum bt_iso_timestamp { - BT_ISO_TS_ABSENT = 0, - BT_ISO_TS_PRESENT, -}; diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 1598fa2e04d..6065c7c19bb 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -122,7 +122,7 @@ static void seg_destroy(struct net_buf *seg) get_seg_md(seg)->lechan = NULL; - LOG_DBG("destroy %p (parent %p)", seg, lechan->tx_buf); + LOG_INF("destroy %p (parent %p)", seg, lechan->tx_buf); /* allow next view to be allocated (and unlock the parent buf) */ bt_buf_destroy_view(seg, &get_seg_md(seg)->view_meta); @@ -145,7 +145,7 @@ static struct net_buf *get_seg(struct net_buf *sdu, if ((seg_size >= sdu->len) && (net_buf_headroom(sdu) >= BT_L2CAP_BUF_SIZE(0))) { - LOG_DBG("view >= bufsize, returning it"); + LOG_INF("view >= bufsize, returning it"); return sdu; } @@ -164,7 +164,7 @@ static struct net_buf *get_seg(struct net_buf *sdu, view = bt_buf_make_view(view, net_buf_ref(sdu), seg_size, &get_seg_md(view)->view_meta); - LOG_DBG("alloc-w-view: sdu %p view %p size %d", sdu, view, seg_size); + LOG_INF("alloc-w-view: sdu %p view %p size %d", sdu, view, seg_size); return view; } @@ -322,12 +322,9 @@ void bt_l2cap_chan_set_state(struct bt_l2cap_chan *chan, #endif /* CONFIG_BT_L2CAP_LOG_LEVEL_DBG */ #endif /* CONFIG_BT_L2CAP_DYNAMIC_CHANNEL */ -static void cancel_data_ready(struct bt_l2cap_le_chan *lechan); -static bool chan_has_data(struct bt_l2cap_le_chan *lechan); 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); LOG_DBG("conn %p chan %p", chan->conn, chan); @@ -335,17 +332,6 @@ void bt_l2cap_chan_del(struct bt_l2cap_chan *chan) goto destroy; } - cancel_data_ready(le_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 (chan_has_data(le_chan)) { - struct net_buf *buf = net_buf_get(&le_chan->_pdu_tx_queue, K_NO_WAIT); - - net_buf_unref(buf); - } - if (ops->disconnected) { ops->disconnected(chan); } @@ -479,8 +465,6 @@ void bt_l2cap_connected(struct bt_conn *conn) return; } - k_fifo_init(&le_chan->_pdu_tx_queue); - if (chan->ops->connected) { chan->ops->connected(chan); } @@ -735,59 +719,18 @@ struct net_buf *bt_l2cap_create_pdu_timeout(struct net_buf_pool *pool, timeout); } -static void raise_data_ready(struct bt_l2cap_le_chan *le_chan) -{ - if (!atomic_set(&le_chan->_pdu_ready_lock, 1)) { - sys_slist_append(&le_chan->chan.conn->l2cap_data_ready, - &le_chan->_pdu_ready); - LOG_DBG("data ready raised"); - } else { - LOG_DBG("data ready already"); - } - - bt_conn_data_ready(le_chan->chan.conn); -} - -static void lower_data_ready(struct bt_l2cap_le_chan *le_chan) -{ - struct bt_conn *conn = le_chan->chan.conn; - sys_snode_t *s = sys_slist_get(&conn->l2cap_data_ready); - - __ASSERT_NO_MSG(s == &le_chan->_pdu_ready); - (void)s; - - atomic_t old = atomic_set(&le_chan->_pdu_ready_lock, 0); - - __ASSERT_NO_MSG(old); - (void)old; -} - -static void cancel_data_ready(struct bt_l2cap_le_chan *le_chan) -{ - struct bt_conn *conn = le_chan->chan.conn; - - sys_slist_find_and_remove(&conn->l2cap_data_ready, - &le_chan->_pdu_ready); - atomic_set(&le_chan->_pdu_ready_lock, 0); -} - -int bt_l2cap_send_cb(struct bt_conn *conn, uint16_t cid, struct net_buf *seg, +int bt_l2cap_send_cb(struct bt_conn *conn, uint16_t cid, struct net_buf *buf, bt_conn_tx_cb_t cb, void *user_data) { struct bt_l2cap_hdr *hdr; - LOG_DBG("conn %p cid %u len %zu", conn, cid, seg->len); + LOG_DBG("conn %p cid %u len %zu", conn, cid, buf->len); - hdr = net_buf_push(seg, sizeof(*hdr)); - hdr->len = sys_cpu_to_le16(seg->len - sizeof(*hdr)); + hdr = net_buf_push(buf, sizeof(*hdr)); + hdr->len = sys_cpu_to_le16(buf->len - sizeof(*hdr)); hdr->cid = sys_cpu_to_le16(cid); - /* TODO: un-foreach this: ATT, SMP & L2CAP CoC _know_ the channel */ - struct bt_l2cap_chan *ch = bt_l2cap_le_lookup_tx_cid(conn, cid); - - struct bt_l2cap_le_chan *chan = CONTAINER_OF(ch, struct bt_l2cap_le_chan, chan); - - if (seg->ref != 1) { + if (buf->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 @@ -797,93 +740,7 @@ int bt_l2cap_send_cb(struct bt_conn *conn, uint16_t cid, struct net_buf *seg, return -EINVAL; } - if (seg->user_data_size < sizeof(struct closure)) { - LOG_DBG("not enough room in user_data %d < %d pool %u", - seg->user_data_size, - CONFIG_BT_CONN_TX_USER_DATA_SIZE, - seg->pool_id); - return -EINVAL; - } - - make_closure(seg->user_data, cb, user_data); - LOG_DBG("push: cb %p userdata %p", cb, user_data); - - net_buf_put(&chan->_pdu_tx_queue, seg); - - raise_data_ready(chan); /* tis just a flag */ - - return 0; /* look ma, no failures */ -} - -/* L2CAP channel wants to send a PDU */ -static bool chan_has_data(struct bt_l2cap_le_chan *lechan) -{ - return !k_fifo_is_empty(&lechan->_pdu_tx_queue); -} - -struct net_buf *l2cap_data_pull(struct bt_conn *conn, size_t amount) -{ - sys_snode_t *pdu_ready = sys_slist_peek_head(&conn->l2cap_data_ready); - - if (!pdu_ready) { - LOG_DBG("nothing to send on this conn"); - return NULL; - } - - struct bt_l2cap_le_chan *lechan = CONTAINER_OF(pdu_ready, - struct bt_l2cap_le_chan, - _pdu_ready); - - /* For dynamic channels, we always have credits to send that segment/PDU - * as the channel is only marked "ready" when a PDU is segmented out - * from an SDU. We only do that segmentation when we know we have at - * least one credit (ie can send >= 1 PDU). - */ - - /* Leave the PDU buffer in the queue until we have sent all its - * fragments. - */ - struct net_buf *pdu = k_fifo_peek_head(&lechan->_pdu_tx_queue); - - __ASSERT(pdu, "signaled ready but no PDUs in the TX queue"); - - if (bt_buf_has_view(pdu)) { - LOG_ERR("already have view on %p", pdu); - return NULL; - } - - /* 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. - */ - bool last_frag = amount >= pdu->len; - - if (last_frag) { - LOG_DBG("last frag, removing %p", pdu); - struct net_buf *b = k_fifo_get(&lechan->_pdu_tx_queue, K_NO_WAIT); - - __ASSERT_NO_MSG(b == pdu); - (void)b; - - /* Lowering the "request to send" and raising it again allows - * fair scheduling of channels on an ACL link: the channel is - * marked as "ready to send" by adding a reference to it on a - * FIFO on `conn`. Adding it again will send it to the back of - * the queue. - * - * TODO: add a user-controlled QoS function. - */ - LOG_DBG("chan %p done", lechan); - lower_data_ready(lechan); - - /* Append channel to list if it still has data */ - if (chan_has_data(lechan)) { - LOG_DBG("chan %p ready", lechan); - raise_data_ready(lechan); - } - } - - return pdu; + return bt_conn_send_cb(conn, buf, cb, user_data); } static void l2cap_send_reject(struct bt_conn *conn, uint8_t ident, @@ -1159,7 +1016,7 @@ static void l2cap_chan_tx_process(struct k_work *work) ch = CONTAINER_OF(k_work_delayable_from_work(work), struct bt_l2cap_le_chan, tx_work); - LOG_DBG("%p", ch); + LOG_INF("%s: %p", __func__, ch); if (bt_l2cap_chan_get_state(&ch->chan) != BT_L2CAP_CONNECTED) { LOG_DBG("Cannot send on non-connected channel"); @@ -1181,7 +1038,7 @@ static void l2cap_chan_tx_process(struct k_work *work) * will be restarted upon receiving credits and * when a segment buffer is freed. */ - LOG_DBG("out of credits/windows"); + LOG_INF("out of credits/windows"); ch->tx_buf = buf; /* If we don't reschedule, and the app doesn't nudge l2cap (e.g. by @@ -1207,7 +1064,6 @@ static void l2cap_chan_tx_init(struct bt_l2cap_le_chan *chan) (void)memset(&chan->tx, 0, sizeof(chan->tx)); atomic_set(&chan->tx.credits, 0); k_fifo_init(&chan->tx_queue); - k_fifo_init(&chan->_pdu_tx_queue); k_work_init_delayable(&chan->tx_work, l2cap_chan_tx_process); } @@ -1253,12 +1109,12 @@ static void l2cap_chan_destroy(struct bt_l2cap_chan *chan) le_chan->tx_buf = NULL; } - /* Remove buffers on the SDU TX queue */ + /* Remove buffers on the TX queue */ while ((buf = net_buf_get(&le_chan->tx_queue, K_NO_WAIT))) { l2cap_tx_buf_destroy(chan->conn, buf, -ESHUTDOWN); } - /* Remove buffers on the SDU RX queue */ + /* Remove buffers on the RX queue */ while ((buf = net_buf_get(&le_chan->rx_queue, K_NO_WAIT))) { net_buf_unref(buf); } @@ -2068,13 +1924,8 @@ static void le_disconn_rsp(struct bt_l2cap *l2cap, uint8_t ident, static void l2cap_chan_tx_resume(struct bt_l2cap_le_chan *ch) { - /* Resume sending PDUs when both conditions are met: - * - we have at least one credit - * - there is at least one SDU waiting to be sent - */ if (!atomic_get(&ch->tx.credits) || (k_fifo_is_empty(&ch->tx_queue) && !ch->tx_buf)) { - LOG_DBG("ch %p idle", ch); return; } @@ -2195,10 +2046,10 @@ static int l2cap_chan_le_send_seg(struct bt_l2cap_le_chan *ch, struct net_buf *b * directly. */ if (buf->len == 0 || (buf == seg && buf->len == len)) { - LOG_DBG("last PDU"); + LOG_INF("last PDU"); cb = l2cap_chan_sdu_sent; } else { - LOG_DBG("send PDU left %u", buf->len); + LOG_INF("send PDU left %u", buf->len); cb = l2cap_chan_seg_sent; } @@ -2217,7 +2068,7 @@ static int l2cap_chan_le_send_seg(struct bt_l2cap_le_chan *ch, struct net_buf *b __ASSERT_NO_MSG(!err || err == -ENOTCONN); if (err) { - LOG_DBG("Unable to send seg %d", err); + LOG_INF("Unable to send seg %d", err); atomic_inc(&ch->tx.credits); /* The host takes ownership of the reference in seg when diff --git a/subsys/bluetooth/host/l2cap_internal.h b/subsys/bluetooth/host/l2cap_internal.h index 16ea2cf4b5c..9f3471ce29f 100644 --- a/subsys/bluetooth/host/l2cap_internal.h +++ b/subsys/bluetooth/host/l2cap_internal.h @@ -252,6 +252,3 @@ void bt_l2cap_register_ecred_cb(const struct bt_l2cap_ecred_cb *cb); /* Returns a server if it exists for given psm. */ struct bt_l2cap_server *bt_l2cap_server_lookup_psm(uint16_t psm); - -/* Pull data from the L2CAP layer */ -struct net_buf *l2cap_data_pull(struct bt_conn *conn, size_t amount); diff --git a/tests/bsim/bluetooth/ll/bis/src/main.c b/tests/bsim/bluetooth/ll/bis/src/main.c index 5fe2635565a..d34a9447424 100644 --- a/tests/bsim/bluetooth/ll/bis/src/main.c +++ b/tests/bsim/bluetooth/ll/bis/src/main.c @@ -153,8 +153,7 @@ bool ll_data_path_sink_create(uint16_t handle, struct ll_iso_datapath *datapath, #define BUF_ALLOC_TIMEOUT_MS (30) /* milliseconds */ NET_BUF_POOL_FIXED_DEFINE(tx_pool, CONFIG_BT_ISO_TX_BUF_COUNT, - BT_ISO_SDU_BUF_SIZE(CONFIG_BT_ISO_TX_MTU), - CONFIG_BT_CONN_TX_USER_DATA_SIZE, NULL); + BT_ISO_SDU_BUF_SIZE(CONFIG_BT_ISO_TX_MTU), 8, NULL); static struct k_work_delayable iso_send_work; From a9d6f380b020cab0d40d7bb24d7fadb915c98435 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 220/825] Revert "[nrf fromtree] Bluetooth: host: Introduce "view" buffer concept" This reverts commit f8806d0738f277ed56ecee15ac941edf106374ae. --- include/zephyr/bluetooth/l2cap.h | 1 - subsys/bluetooth/host/Kconfig | 8 - subsys/bluetooth/host/buf.c | 68 ------ subsys/bluetooth/host/buf_view.h | 85 -------- subsys/bluetooth/host/classic/l2cap_br.c | 1 - subsys/bluetooth/host/conn.c | 184 ++++++++-------- subsys/bluetooth/host/iso.c | 27 +++ subsys/bluetooth/host/l2cap.c | 200 ++++++------------ .../bluetooth/host/l2cap/stress/src/main.c | 44 ++-- 9 files changed, 211 insertions(+), 407 deletions(-) delete mode 100644 subsys/bluetooth/host/buf_view.h diff --git a/include/zephyr/bluetooth/l2cap.h b/include/zephyr/bluetooth/l2cap.h index aeab4905041..4ba0610b77d 100644 --- a/include/zephyr/bluetooth/l2cap.h +++ b/include/zephyr/bluetooth/l2cap.h @@ -597,7 +597,6 @@ int bt_l2cap_chan_disconnect(struct bt_l2cap_chan *chan); * @return -EINVAL if `buf` or `chan` is NULL. * @return -EINVAL if `chan` is not either BR/EDR or LE credit-based. * @return -EINVAL if buffer doesn't have enough bytes reserved to fit header. - * @return -EINVAL if buffer's reference counter != 1 * @return -EMSGSIZE if `buf` is larger than `chan`'s MTU. * @return -ENOTCONN if underlying conn is disconnected. * @return -ESHUTDOWN if L2CAP channel is disconnected. diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 281407fdcf4..4892f3aff11 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -273,14 +273,6 @@ config BT_CONN_TX_USER_DATA_SIZE Necessary user_data size for allowing packet fragmentation when sending over HCI. See `struct tx_meta` in conn.c. -config BT_CONN_FRAG_COUNT - int - default BT_MAX_CONN if BT_CONN - default BT_ISO_MAX_CHAN if BT_ISO - help - Internal kconfig that sets the maximum amount of simultaneous data - packets in flight. It should be equal to the number of connections. - if BT_CONN config BT_CONN_TX_MAX diff --git a/subsys/bluetooth/host/buf.c b/subsys/bluetooth/host/buf.c index 7dad7a67aec..1f2918fb8a9 100644 --- a/subsys/bluetooth/host/buf.c +++ b/subsys/bluetooth/host/buf.c @@ -8,16 +8,12 @@ #include #include -#include "buf_view.h" #include "hci_core.h" #include "conn_internal.h" #include "iso_internal.h" #include -#include -LOG_MODULE_REGISTER(bt_buf, CONFIG_BT_LOG_LEVEL); - #if defined(CONFIG_BT_CONN) #if defined(CONFIG_BT_ISO) #define MAX_EVENT_COUNT CONFIG_BT_MAX_CONN + CONFIG_BT_ISO_MAX_CHAN @@ -151,67 +147,3 @@ struct net_buf_pool *bt_buf_get_num_complete_pool(void) } #endif /* CONFIG_BT_CONN || CONFIG_BT_ISO */ #endif /* ZTEST_UNITTEST */ - -struct net_buf *bt_buf_make_view(struct net_buf *view, - struct net_buf *parent, - size_t len, - struct bt_buf_view_meta *meta) -{ - __ASSERT_NO_MSG(len); - __ASSERT_NO_MSG(view); - /* The whole point of this API is to allow prepending data. If the - * headroom is 0, that will not happen. - */ - __ASSERT_NO_MSG(net_buf_headroom(parent) > 0); - - /* `parent` should have been just re-used instead of trying to make a - * view into it. - */ - __ASSERT_NO_MSG(len < parent->len); - - __ASSERT_NO_MSG(!bt_buf_has_view(parent)); - - LOG_DBG("make-view %p viewsize %u meta %p", view, len, meta); - - net_buf_simple_clone(&parent->b, &view->b); - view->size = net_buf_headroom(parent) + len; - view->len = len; - view->flags = NET_BUF_EXTERNAL_DATA; - - /* we have a view, eat `len`'s worth of data from the parent */ - (void)net_buf_pull(parent, len); - - meta->backup.data = parent->data; - parent->data = NULL; - - meta->backup.size = parent->size; - parent->size = 0; - - /* The ref to `parent` is moved in by passing `parent` as argument. */ - /* save backup & "clip" the buffer so the next `make_view` will fail */ - meta->parent = parent; - parent = NULL; - - return view; -} - -void bt_buf_destroy_view(struct net_buf *view, struct bt_buf_view_meta *meta) -{ - LOG_DBG("destroy-view %p meta %p", view, meta); - __ASSERT_NO_MSG(meta->parent); - - /* "unclip" the parent buf */ - meta->parent->data = meta->backup.data; - meta->parent->size = meta->backup.size; - - net_buf_unref(meta->parent); - - memset(meta, 0, sizeof(*meta)); - net_buf_destroy(view); -} - -bool bt_buf_has_view(const struct net_buf *parent) -{ - /* This is enforced by `make_view`. see comment there. */ - return parent->size == 0 && parent->data == NULL; -} diff --git a/subsys/bluetooth/host/buf_view.h b/subsys/bluetooth/host/buf_view.h deleted file mode 100644 index 1e4a52266f2..00000000000 --- a/subsys/bluetooth/host/buf_view.h +++ /dev/null @@ -1,85 +0,0 @@ -/** @file - * @brief Bluetooth "view" buffer abstraction - */ - -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_SUBSYS_BLUETOOTH_HOST_BUF_VIEW_H_ -#define ZEPHYR_SUBSYS_BLUETOOTH_HOST_BUF_VIEW_H_ - -#include - - -struct bt_buf_view_meta { - struct net_buf *parent; - /* saves the data pointers while the parent buffer is locked. */ - struct net_buf_simple backup; -}; - -/** @internal - * - * @brief Create a "view" or "window" into an existing buffer. - * - enforces one active view at a time per-buffer - * -> this restriction enables prepending data (ie. for headers) - * - forbids appending data to the view - * - pulls the size of the view from said buffer. - * - * The "virtual buffer" that is generated has to be allocated from a buffer - * pool. This is to allow refcounting and attaching a destroy callback. The - * configured size of the buffers in that pool should be zero-length. - * - * The user-data size is application-dependent, but should be minimized to save - * memory. user_data is not used by the view API. - * - * The view mechanism needs to store extra metadata in order to unlock the - * original buffer when the view is destroyed. - * - * The storage and allocation of the view buf pool and the view metadata is the - * application's responsibility. - * - * @note The `headroom` param is only used for __ASSERT(). The idea is that - * it's easier to debug a headroom assert failure at allocation time, rather - * than later down the line when a lower layer tries to add its headers and - * fails. - * - * @param view Uninitialized "View" buffer - * @param parent Buffer data is pulled from into `view` - * @param len Amount to pull - * @param meta Uninitialized metadata storage - * - * @return view if the operation was successful. NULL on error. - */ -struct net_buf *bt_buf_make_view(struct net_buf *view, - struct net_buf *parent, - size_t len, - struct bt_buf_view_meta *meta); - -/** @internal - * - * @brief Check if if `parent` has view. - * - * If `parent` has been passed to @ref bt_buf_make_view() and the resulting - * view buffer has not been destroyed. - */ -bool bt_buf_has_view(const struct net_buf *parent); - -/** @internal - * - * @brief Destroy the view buffer - * - * Equivalent of @ref net_buf_destroy. - * It is mandatory to call this from the view pool's `destroy` callback. - * - * This frees the parent buffer, and allows calling @ref bt_buf_make_view again. - * The metadata is also freed for re-use. - * - * @param view View to destroy - * @param meta Meta that was given to @ref bt_buf_make_view - */ -void bt_buf_destroy_view(struct net_buf *view, struct bt_buf_view_meta *meta); - -#endif /* ZEPHYR_SUBSYS_BLUETOOTH_HOST_BUF_VIEW_H_ */ diff --git a/subsys/bluetooth/host/classic/l2cap_br.c b/subsys/bluetooth/host/classic/l2cap_br.c index a1854a2489a..2174aa1ceb1 100644 --- a/subsys/bluetooth/host/classic/l2cap_br.c +++ b/subsys/bluetooth/host/classic/l2cap_br.c @@ -19,7 +19,6 @@ #include #include -#include "host/buf_view.h" #include "host/hci_core.h" #include "host/conn_internal.h" #include "l2cap_br_internal.h" diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 9c5ea4eadc5..5f5a01272f9 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -30,7 +30,6 @@ #include "common/assert.h" #include "common/bt_str.h" -#include "buf_view.h" #include "addr_internal.h" #include "hci_core.h" #include "id.h" @@ -105,6 +104,19 @@ NET_BUF_POOL_DEFINE(acl_tx_pool, CONFIG_BT_L2CAP_TX_BUF_COUNT, BT_L2CAP_BUF_SIZE(CONFIG_BT_L2CAP_TX_MTU), CONFIG_BT_CONN_TX_USER_DATA_SIZE, NULL); +#if CONFIG_BT_L2CAP_TX_FRAG_COUNT > 0 +/* Dedicated pool for fragment buffers in case queued up TX buffers don't + * fit the controllers buffer size. We can't use the acl_tx_pool for the + * fragmentation, since it's possible that pool is empty and all buffers + * are queued up in the TX queue. In such a situation, trying to allocate + * another buffer from the acl_tx_pool would result in a deadlock. + */ +NET_BUF_POOL_FIXED_DEFINE(frag_pool, CONFIG_BT_L2CAP_TX_FRAG_COUNT, + BT_BUF_ACL_SIZE(CONFIG_BT_BUF_ACL_TX_SIZE), + CONFIG_BT_CONN_TX_USER_DATA_SIZE, NULL); + +#endif /* CONFIG_BT_L2CAP_TX_FRAG_COUNT > 0 */ + #if defined(CONFIG_BT_SMP) || defined(CONFIG_BT_CLASSIC) const struct bt_conn_auth_cb *bt_auth; sys_slist_t bt_auth_info_cbs = SYS_SLIST_STATIC_INIT(&bt_auth_info_cbs); @@ -122,54 +134,6 @@ static struct bt_conn sco_conns[CONFIG_BT_MAX_SCO_CONN]; #endif /* CONFIG_BT_CLASSIC */ #endif /* CONFIG_BT_CONN */ -#if defined(CONFIG_BT_CONN_TX) -void frag_destroy(struct net_buf *buf); - -/* Storage for fragments (views) into the upper layers' PDUs. */ -/* TODO: remove user-data requirements */ -NET_BUF_POOL_FIXED_DEFINE(fragments, CONFIG_BT_CONN_FRAG_COUNT, 0, - CONFIG_BT_CONN_TX_USER_DATA_SIZE, frag_destroy); - -struct frag_md { - struct bt_buf_view_meta view_meta; -}; -struct frag_md frag_md_pool[CONFIG_BT_CONN_FRAG_COUNT]; - -struct frag_md *get_frag_md(struct net_buf *fragment) -{ - return &frag_md_pool[net_buf_id(fragment)]; -} - -void bt_tx_irq_raise(void); -void frag_destroy(struct net_buf *frag) -{ - /* allow next view to be allocated (and unlock the parent buf) */ - bt_buf_destroy_view(frag, &get_frag_md(frag)->view_meta); -} - -static struct net_buf *get_acl_frag(struct net_buf *outside, size_t winsize) -{ - struct net_buf *window; - - __ASSERT_NO_MSG(!bt_buf_has_view(outside)); - - /* Keeping a ref is the caller's responsibility */ - window = net_buf_alloc_len(&fragments, 0, K_NO_WAIT); - if (!window) { - return window; - } - - __ASSERT_NO_MSG(outside->ref == 1); - - window = bt_buf_make_view(window, net_buf_ref(outside), - winsize, &get_frag_md(window)->view_meta); - - LOG_INF("get-acl-frag: outside %p window %p size %d", outside, window, winsize); - - return window; -} -#endif /* CONFIG_BT_CONN_TX */ - #if defined(CONFIG_BT_ISO) extern struct bt_conn iso_conns[CONFIG_BT_ISO_MAX_CHAN]; @@ -699,21 +663,12 @@ static int do_send_frag(struct bt_conn *conn, struct net_buf *buf, uint8_t flags return err; } -static bool fits_single_ctlr_buf(struct net_buf *buf, struct bt_conn *conn) -{ - return buf->len <= conn_mtu(conn); -} - -static int send_frag(struct bt_conn *conn, struct net_buf *buf, uint8_t flags) +static int send_frag(struct bt_conn *conn, + struct net_buf *buf, struct net_buf *frag, + uint8_t flags) { - struct net_buf *frag; struct bt_conn_tx *tx = NULL; - if (bt_buf_has_view(buf)) { - LOG_ERR("already have view"); - return -EWOULDBLOCK; - } - /* Check if the controller can accept ACL packets */ if (k_sem_take(bt_conn_get_pkts(conn), K_NO_WAIT)) { LOG_DBG("no controller bufs"); @@ -728,25 +683,12 @@ static int send_frag(struct bt_conn *conn, struct net_buf *buf, uint8_t flags) return -ENOTCONN; } - if (!fits_single_ctlr_buf(buf, conn)) { - uint16_t frag_len = MIN(conn_mtu(conn), buf->len); - - LOG_DBG("send frag: buf %p len %d", buf, frag_len); - - /* will also do a pull */ - frag = get_acl_frag(buf, frag_len); - /* Fragments never have a TX completion callback */ - tx_data(frag)->cb = NULL; - tx_data(frag)->is_cont = false; - - int err = do_send_frag(conn, frag, flags, tx); - - if (err == -EIO) { - net_buf_unref(frag); - } - - return err; + /* Add the data to the buffer */ + if (frag) { + uint16_t frag_len = MIN(conn_mtu(conn), net_buf_tailroom(frag)); + net_buf_add_mem(frag, buf->data, frag_len); + net_buf_pull(buf, frag_len); } else { if (tx_data(buf)->cb) { tx = conn_tx_alloc(); @@ -769,9 +711,41 @@ static int send_frag(struct bt_conn *conn, struct net_buf *buf, uint8_t flags) */ buf = net_buf_get(&conn->tx_queue, K_NO_WAIT); frag = buf; + } + + return do_send_frag(conn, frag, flags, tx); +} + +static struct net_buf *create_frag(struct bt_conn *conn, struct net_buf *buf) +{ + struct net_buf *frag; - return do_send_frag(conn, frag, flags, tx); + switch (conn->type) { +#if defined(CONFIG_BT_ISO) + case BT_CONN_TYPE_ISO: + frag = bt_iso_create_frag(0); + break; +#endif + default: +#if defined(CONFIG_BT_CONN) + frag = bt_conn_create_frag(0); +#else + return NULL; +#endif /* CONFIG_BT_CONN */ + + } + + if (conn->state != BT_CONN_CONNECTED) { + net_buf_unref(frag); + return NULL; } + + /* Fragments never have a TX completion callback */ + tx_data(frag)->cb = NULL; + tx_data(frag)->is_cont = false; + tx_data(frag)->iso_has_ts = tx_data(buf)->iso_has_ts; + + return frag; } /* Tentatively send a buffer to the HCI driver. @@ -793,22 +767,19 @@ static int send_frag(struct bt_conn *conn, struct net_buf *buf, uint8_t flags) */ static int send_buf(struct bt_conn *conn, struct net_buf *buf) { + struct net_buf *frag; uint8_t flags; int err; LOG_DBG("conn %p buf %p len %u", conn, buf, buf->len); - if (bt_buf_has_view(buf)) { - LOG_DBG("locked by existing view"); - return -EWOULDBLOCK; - } - /* Send directly if the packet fits the ACL MTU */ if (buf->len <= conn_mtu(conn) && !tx_data(buf)->is_cont) { LOG_DBG("send single"); - return send_frag(conn, buf, FRAG_SINGLE); + return send_frag(conn, buf, NULL, FRAG_SINGLE); } + LOG_DBG("start fragmenting"); /* * Send the fragments. For the last one simply use the original * buffer (which works since we've used net_buf_pull on it). @@ -819,22 +790,25 @@ static int send_buf(struct bt_conn *conn, struct net_buf *buf) } while (buf->len > conn_mtu(conn)) { - tx_data(buf)->is_cont = true; - err = send_frag(conn, buf, flags); + frag = create_frag(conn, buf); + if (!frag) { + return -ENOMEM; + } + + err = send_frag(conn, buf, frag, flags); if (err) { LOG_DBG("%p failed, mark as existing frag", buf); + tx_data(buf)->is_cont = flags != FRAG_START; + net_buf_unref(frag); return err; } flags = FRAG_CONT; } - bool single = flags == FRAG_START; - - LOG_DBG("send %s", single ? "single" : "last"); - - /* Frag is either a direct-send or the last in the series. */ - return send_frag(conn, buf, single ? FRAG_SINGLE : FRAG_END); + LOG_DBG("last frag"); + tx_data(buf)->is_cont = true; + return send_frag(conn, buf, NULL, FRAG_END); } static struct k_poll_signal conn_change = @@ -3434,6 +3408,28 @@ int bt_conn_le_conn_update(struct bt_conn *conn, return bt_hci_cmd_send_sync(BT_HCI_OP_LE_CONN_UPDATE, buf, NULL); } +#if defined(CONFIG_NET_BUF_LOG) +struct net_buf *bt_conn_create_frag_timeout_debug(size_t reserve, + k_timeout_t timeout, + const char *func, int line) +#else +struct net_buf *bt_conn_create_frag_timeout(size_t reserve, k_timeout_t timeout) +#endif +{ + struct net_buf_pool *pool = NULL; + +#if CONFIG_BT_L2CAP_TX_FRAG_COUNT > 0 + pool = &frag_pool; +#endif + +#if defined(CONFIG_NET_BUF_LOG) + return bt_conn_create_pdu_timeout_debug(pool, reserve, timeout, + func, line); +#else + return bt_conn_create_pdu_timeout(pool, reserve, timeout); +#endif /* CONFIG_NET_BUF_LOG */ +} + #if defined(CONFIG_BT_SMP) || defined(CONFIG_BT_CLASSIC) int bt_conn_auth_cb_register(const struct bt_conn_auth_cb *cb) { diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c index 22e3466ad33..e4dab861c2d 100644 --- a/subsys/bluetooth/host/iso.c +++ b/subsys/bluetooth/host/iso.c @@ -48,6 +48,11 @@ NET_BUF_POOL_FIXED_DEFINE(iso_tx_pool, CONFIG_BT_ISO_TX_BUF_COUNT, BT_ISO_SDU_BUF_SIZE(CONFIG_BT_ISO_TX_MTU), CONFIG_BT_CONN_TX_USER_DATA_SIZE, NULL); +#if CONFIG_BT_ISO_TX_FRAG_COUNT > 0 +NET_BUF_POOL_FIXED_DEFINE(iso_frag_pool, CONFIG_BT_ISO_TX_FRAG_COUNT, + BT_ISO_SDU_BUF_SIZE(CONFIG_BT_ISO_TX_MTU), + CONFIG_BT_CONN_TX_USER_DATA_SIZE, NULL); +#endif /* CONFIG_BT_ISO_TX_FRAG_COUNT > 0 */ #endif /* CONFIG_BT_ISO_UNICAST || CONFIG_BT_ISO_BROADCAST */ struct bt_conn iso_conns[CONFIG_BT_ISO_MAX_CHAN]; @@ -173,6 +178,28 @@ struct net_buf *bt_iso_create_pdu_timeout(struct net_buf_pool *pool, #endif } +#if defined(CONFIG_NET_BUF_LOG) +struct net_buf *bt_iso_create_frag_timeout_debug(size_t reserve, + k_timeout_t timeout, + const char *func, int line) +#else +struct net_buf *bt_iso_create_frag_timeout(size_t reserve, k_timeout_t timeout) +#endif +{ + struct net_buf_pool *pool = NULL; + +#if CONFIG_BT_ISO_TX_FRAG_COUNT > 0 + pool = &iso_frag_pool; +#endif /* CONFIG_BT_ISO_TX_FRAG_COUNT > 0 */ + +#if defined(CONFIG_NET_BUF_LOG) + return bt_conn_create_pdu_timeout_debug(pool, reserve, timeout, func, + line); +#else + return bt_conn_create_pdu_timeout(pool, reserve, timeout); +#endif +} + static int hci_le_setup_iso_data_path(const struct bt_conn *iso, uint8_t dir, const struct bt_iso_chan_path *path) { diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 6065c7c19bb..df312f5dd03 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -26,7 +25,6 @@ #define LOG_DBG_ENABLED IS_ENABLED(CONFIG_BT_L2CAP_LOG_LEVEL_DBG) -#include "buf_view.h" #include "hci_core.h" #include "conn_internal.h" #include "l2cap_internal.h" @@ -90,86 +88,6 @@ struct bt_l2cap { static const struct bt_l2cap_ecred_cb *ecred_cb; static struct bt_l2cap bt_l2cap_pool[CONFIG_BT_MAX_CONN]; -static void seg_destroy(struct net_buf *buf); -#define SEGMENTS_COUNT CONFIG_BT_MAX_CONN -/* see equivalent struct in conn.c */ -NET_BUF_POOL_FIXED_DEFINE(seg_pool, SEGMENTS_COUNT, 0, - CONFIG_BT_CONN_TX_USER_DATA_SIZE, seg_destroy); - -struct seg_md { - struct bt_l2cap_le_chan *lechan; - struct bt_buf_view_meta view_meta; -}; - -struct seg_md seg_md_pool[SEGMENTS_COUNT]; - -struct seg_md *get_seg_md(struct net_buf *seg) -{ - return &seg_md_pool[net_buf_id(seg)]; -} - -#if defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL) -static void l2cap_chan_tx_resume(struct bt_l2cap_le_chan *ch); -#endif - -static void seg_destroy(struct net_buf *seg) -{ - /* Only relevant if there is segmentation going on. This is not possible - * for LE ACL fixed channels, only for credit-based ones. - */ -#if defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL) - struct bt_l2cap_le_chan *lechan = get_seg_md(seg)->lechan; - - get_seg_md(seg)->lechan = NULL; - - LOG_INF("destroy %p (parent %p)", seg, lechan->tx_buf); - - /* allow next view to be allocated (and unlock the parent buf) */ - bt_buf_destroy_view(seg, &get_seg_md(seg)->view_meta); - - /* try to allocate and send next view PDU */ - l2cap_chan_tx_resume(lechan); -#endif -} - -#if defined(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL) -static struct net_buf *get_seg(struct net_buf *sdu, - size_t seg_size, - struct bt_l2cap_le_chan *lechan) -{ - struct net_buf *view; - - __ASSERT_NO_MSG(!bt_buf_has_view(sdu)); - - /* optimization: don't allocate if we know `make_view` will return `sdu` */ - if ((seg_size >= sdu->len) && - (net_buf_headroom(sdu) >= BT_L2CAP_BUF_SIZE(0))) { - - LOG_INF("view >= bufsize, returning it"); - - return sdu; - } - - /* Keeping a ref is the caller's responsibility */ - view = net_buf_alloc(&seg_pool, K_NO_WAIT); - if (!view) { - /* This should never happen? If pool properly configured. */ - __ASSERT_NO_MSG(view); - return NULL; - } - - __ASSERT_NO_MSG(sdu->ref == 1); - - get_seg_md(view)->lechan = lechan; - view = bt_buf_make_view(view, net_buf_ref(sdu), - seg_size, &get_seg_md(view)->view_meta); - - LOG_INF("alloc-w-view: sdu %p view %p size %d", sdu, view, seg_size); - - return view; -} -#endif /* CONFIG_BT_L2CAP_DYNAMIC_CHANNEL */ - void bt_l2cap_register_ecred_cb(const struct bt_l2cap_ecred_cb *cb) { ecred_cb = cb; @@ -730,16 +648,6 @@ int bt_l2cap_send_cb(struct bt_conn *conn, uint16_t cid, struct net_buf *buf, hdr->len = sys_cpu_to_le16(buf->len - sizeof(*hdr)); hdr->cid = sys_cpu_to_le16(cid); - if (buf->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 1 ref, got %d", seg->ref); - return -EINVAL; - } - return bt_conn_send_cb(conn, buf, cb, user_data); } @@ -1016,8 +924,6 @@ static void l2cap_chan_tx_process(struct k_work *work) ch = CONTAINER_OF(k_work_delayable_from_work(work), struct bt_l2cap_le_chan, tx_work); - LOG_INF("%s: %p", __func__, ch); - if (bt_l2cap_chan_get_state(&ch->chan) != BT_L2CAP_CONNECTED) { LOG_DBG("Cannot send on non-connected channel"); return; @@ -1034,25 +940,17 @@ static void l2cap_chan_tx_process(struct k_work *work) ret = l2cap_chan_le_send_sdu(ch, buf); if (ret < 0) { if (ret == -EAGAIN) { - /* Out of credits or buffer already locked. Work - * will be restarted upon receiving credits and - * when a segment buffer is freed. - */ - LOG_INF("out of credits/windows"); - ch->tx_buf = buf; /* If we don't reschedule, and the app doesn't nudge l2cap (e.g. by * sending another SDU), the channel will be stuck in limbo. To * prevent this, we reschedule with a configurable delay. - * FIXME: is this still necessary? */ k_work_schedule(&ch->tx_work, K_MSEC(CONFIG_BT_L2CAP_RESCHED_MS)); } else { LOG_WRN("Failed to send (err %d), dropping buf %p", ret, buf); l2cap_tx_buf_destroy(ch->chan.conn, buf, ret); } - - return; + break; } } } @@ -1922,6 +1820,28 @@ static void le_disconn_rsp(struct bt_l2cap *l2cap, uint8_t ident, bt_l2cap_chan_del(&chan->chan); } +static struct net_buf *l2cap_alloc_seg(struct bt_l2cap_le_chan *ch) +{ + struct net_buf *seg = NULL; + + /* Use the user-defined allocator */ + if (ch->chan.ops->alloc_seg) { + seg = ch->chan.ops->alloc_seg(&ch->chan); + __ASSERT_NO_MSG(seg); + } + + /* Fallback to using global connection tx pool */ + if (!seg) { + seg = bt_l2cap_create_pdu_timeout(NULL, 0, K_NO_WAIT); + } + + if (seg) { + net_buf_reserve(seg, BT_L2CAP_CHAN_SEND_RESERVE); + } + + return seg; +} + static void l2cap_chan_tx_resume(struct bt_l2cap_le_chan *ch) { if (!atomic_get(&ch->tx.credits) || @@ -1976,6 +1896,8 @@ static void l2cap_chan_seg_sent(struct bt_conn *conn, void *user_data, int err) /* Received segment sent callback for disconnected channel */ return; } + + l2cap_chan_tx_resume(BT_L2CAP_LE_CHAN(chan)); } static bool test_and_dec(atomic_t *target) @@ -2004,18 +1926,14 @@ static bool test_and_dec(atomic_t *target) * In all cases the original buffer is unaffected so it can be pushed back to * be sent later. */ -static int l2cap_chan_le_send_seg(struct bt_l2cap_le_chan *ch, struct net_buf *buf) +static int l2cap_chan_le_send(struct bt_l2cap_le_chan *ch, + struct net_buf *buf, uint16_t sdu_hdr_len) { struct net_buf *seg; struct net_buf_simple_state state; int len, err; bt_conn_tx_cb_t cb; - if (bt_buf_has_view(buf)) { - LOG_DBG("Already have TX inflight"); - return -EAGAIN; - } - if (!test_and_dec(&ch->tx.credits)) { LOG_DBG("No credits to transmit packet"); return -EAGAIN; @@ -2024,37 +1942,48 @@ static int l2cap_chan_le_send_seg(struct bt_l2cap_le_chan *ch, struct net_buf *b /* Save state so it can be restored if we failed to send */ net_buf_simple_save(&buf->b, &state); - seg = get_seg(buf, ch->tx.mps, ch); + if ((buf->len <= ch->tx.mps) && + (net_buf_headroom(buf) >= BT_L2CAP_BUF_SIZE(0))) { + LOG_DBG("len <= MPS, not allocating seg for %p", buf); + /* move `buf` to `seg`. `buf` now borrows `seg`. */ + seg = buf; - CHECKIF(!seg) { - /* Future work: Give the channel a tx state - * machine, so that we remember that we took a - * credit and don't need to give it back here. - */ - LOG_WRN("Out of segment buffers."); - atomic_inc(&ch->tx.credits); - return -ENOBUFS; + len = seg->len; + } else { + LOG_DBG("allocating segment for %p (%u bytes left)", buf, buf->len); + seg = l2cap_alloc_seg(ch); + if (!seg) { + LOG_DBG("failed to allocate seg for %p", buf); + atomic_inc(&ch->tx.credits); + + return -EAGAIN; + } + + /* Don't send more than TX MPS */ + len = MIN(net_buf_tailroom(seg), ch->tx.mps); + + /* Limit if original buffer is smaller than the segment */ + len = MIN(buf->len, len); + + net_buf_add_mem(seg, buf->data, len); + net_buf_pull(buf, len); } LOG_DBG("ch %p cid 0x%04x len %u credits %lu", ch, ch->tx.cid, seg->len, atomic_get(&ch->tx.credits)); - len = seg->len; + len = seg->len - sdu_hdr_len; /* SDU will be considered sent when there is no data left in the * buffer, or if there will be no data left, if we are sending `buf` * directly. */ if (buf->len == 0 || (buf == seg && buf->len == len)) { - LOG_INF("last PDU"); cb = l2cap_chan_sdu_sent; } else { - LOG_INF("send PDU left %u", buf->len); cb = l2cap_chan_seg_sent; } - len = seg->len; - /* Forward the PDU to the lower layer. * * Note: after this call, anything in buf->user_data should be @@ -2064,11 +1993,8 @@ static int l2cap_chan_le_send_seg(struct bt_l2cap_le_chan *ch, struct net_buf *b err = bt_l2cap_send_cb(ch->chan.conn, ch->tx.cid, seg, cb, UINT_TO_POINTER(ch->tx.cid)); - /* The only possible error is enotconn, in that case the data will be discarded anyways */ - __ASSERT_NO_MSG(!err || err == -ENOTCONN); - if (err) { - LOG_INF("Unable to send seg %d", err); + LOG_DBG("Unable to send seg %d", err); atomic_inc(&ch->tx.credits); /* The host takes ownership of the reference in seg when @@ -2079,11 +2005,19 @@ static int l2cap_chan_le_send_seg(struct bt_l2cap_le_chan *ch, struct net_buf *b buf == seg ? "orig" : "seg"); if (seg == buf) { - /* move `buf` back to caller */ + /* move `seg` to `buf` */ } else { net_buf_unref(seg); } + if (err == -ENOBUFS) { + /* Restore state since segment could not be sent */ + net_buf_simple_restore(&buf->b, &state); + err = -EAGAIN; + } + + /* move `buf` back to caller */ + return err; } @@ -2115,10 +2049,7 @@ static int l2cap_chan_le_send_sdu(struct bt_l2cap_le_chan *ch, rem_len = buf->len; while (sent != rem_len) { - /* `buf` is moved only when it's full consumed. - * (ie. sent == rem_len) - */ - ret = l2cap_chan_le_send_seg(ch, buf); + ret = l2cap_chan_le_send(ch, buf, 0); if (ret < 0) { LOG_DBG("failed to send buf (ch %p cid 0x%04x sent %d)", ch, ch->tx.cid, sent); @@ -3197,11 +3128,6 @@ int bt_l2cap_chan_send(struct bt_l2cap_chan *chan, struct net_buf *buf) LOG_DBG("chan %p buf %p len %zu", chan, buf, buf->len); - if (buf->ref != 1) { - LOG_DBG("Expecting 1 ref, got %d", buf->ref); - return -EINVAL; - } - if (!chan->conn || chan->conn->state != BT_CONN_CONNECTED) { return -ENOTCONN; } diff --git a/tests/bsim/bluetooth/host/l2cap/stress/src/main.c b/tests/bsim/bluetooth/host/l2cap/stress/src/main.c index e0e761a37b9..6c00eceec3e 100644 --- a/tests/bsim/bluetooth/host/l2cap/stress/src/main.c +++ b/tests/bsim/bluetooth/host/l2cap/stress/src/main.c @@ -20,6 +20,7 @@ CREATE_FLAG(flag_l2cap_connected); #define L2CAP_CHANS NUM_PERIPHERALS #define SDU_NUM 20 #define SDU_LEN 3000 +#define NUM_SEGMENTS 100 #define RESCHEDULE_DELAY K_MSEC(100) static void sdu_destroy(struct net_buf *buf) @@ -29,6 +30,13 @@ static void sdu_destroy(struct net_buf *buf) net_buf_destroy(buf); } +static void segment_destroy(struct net_buf *buf) +{ + LOG_DBG("%p", buf); + + net_buf_destroy(buf); +} + static void rx_destroy(struct net_buf *buf) { LOG_DBG("%p", buf); @@ -41,6 +49,11 @@ NET_BUF_POOL_DEFINE(sdu_tx_pool, CONFIG_BT_MAX_CONN, BT_L2CAP_SDU_BUF_SIZE(SDU_LEN), CONFIG_BT_CONN_TX_USER_DATA_SIZE, sdu_destroy); +NET_BUF_POOL_DEFINE(segment_pool, + /* MTU + 4 l2cap hdr + 4 ACL hdr */ + NUM_SEGMENTS, BT_L2CAP_BUF_SIZE(CONFIG_BT_L2CAP_TX_MTU), + CONFIG_BT_CONN_TX_USER_DATA_SIZE, segment_destroy); + /* Only one SDU per link will be received at a time */ NET_BUF_POOL_DEFINE(sdu_rx_pool, CONFIG_BT_MAX_CONN, BT_L2CAP_SDU_BUF_SIZE(SDU_LEN), @@ -49,6 +62,7 @@ NET_BUF_POOL_DEFINE(sdu_rx_pool, static uint8_t tx_data[SDU_LEN]; static uint16_t rx_cnt; static uint8_t disconnect_counter; +static uint32_t max_seg_allocated; struct test_ctx { struct k_work_delayable work_item; @@ -99,6 +113,19 @@ int l2cap_chan_send(struct bt_l2cap_chan *chan, uint8_t *data, size_t len) return ret; } +struct net_buf *alloc_seg_cb(struct bt_l2cap_chan *chan) +{ + struct net_buf *buf = net_buf_alloc(&segment_pool, K_NO_WAIT); + + if ((NUM_SEGMENTS - segment_pool.avail_count) > max_seg_allocated) { + max_seg_allocated++; + } + + ASSERT(buf, "Ran out of segment buffers"); + + return buf; +} + struct net_buf *alloc_buf_cb(struct bt_l2cap_chan *chan) { return net_buf_alloc(&sdu_rx_pool, K_NO_WAIT); @@ -136,19 +163,7 @@ int recv_cb(struct bt_l2cap_chan *chan, struct net_buf *buf) rx_cnt++; /* Verify SDU data matches TX'd data. */ - int pos = memcmp(buf->data, tx_data, buf->len); - - if (pos != 0) { - LOG_ERR("RX data doesn't match TX: pos %d", pos); - LOG_HEXDUMP_ERR(buf->data, buf->len, "RX data"); - LOG_HEXDUMP_INF(tx_data, buf->len, "TX data"); - - for (uint16_t p = 0; p < buf->len; p++) { - __ASSERT(buf->data[p] == tx_data[p], - "Failed rx[%d]=%x != expect[%d]=%x", - p, buf->data[p], p, tx_data[p]); - } - } + ASSERT(memcmp(buf->data, tx_data, buf->len) == 0, "RX data doesn't match TX"); return 0; } @@ -177,6 +192,7 @@ static struct bt_l2cap_chan_ops ops = { .connected = l2cap_chan_connected_cb, .disconnected = l2cap_chan_disconnected_cb, .alloc_buf = alloc_buf_cb, + .alloc_seg = alloc_seg_cb, .recv = recv_cb, .sent = sent_cb, }; @@ -458,6 +474,8 @@ static void test_central_main(void) } LOG_DBG("All peripherals disconnected."); + LOG_INF("Max segment pool usage: %u bufs", max_seg_allocated); + PASS("L2CAP STRESS Central passed\n"); } From a229d4f0f950fe829202a2168a9122f60e870586 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 221/825] Revert "[nrf fromtree] Bluetooth: conn: Allocate TX context JIT" This reverts commit 3435fef82796ee825767012b850055f6946b6d74. --- subsys/bluetooth/host/Kconfig | 4 +- subsys/bluetooth/host/conn.c | 118 +++++++++++++++----------- subsys/bluetooth/host/conn_internal.h | 2 - subsys/bluetooth/host/hci_core.h | 1 - 4 files changed, 69 insertions(+), 56 deletions(-) diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 4892f3aff11..82ef50aaa72 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -267,8 +267,8 @@ config BT_LIM_ADV_TIMEOUT config BT_CONN_TX_USER_DATA_SIZE int - default 24 if 64BIT - default 12 + default 16 if 64BIT + default 8 help Necessary user_data size for allowing packet fragmentation when sending over HCI. See `struct tx_meta` in conn.c. diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 5f5a01272f9..3643c856e9d 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -50,9 +50,7 @@ LOG_MODULE_REGISTER(bt_conn); struct tx_meta { - bt_conn_tx_cb_t cb; - void *cb_user_data; - + struct bt_conn_tx *tx; /* This flag indicates if the current buffer has already been partially * sent to the controller (ie, the next fragments should be sent as * continuations). @@ -208,7 +206,6 @@ static inline const char *state2str(bt_conn_state_t state) static void tx_free(struct bt_conn_tx *tx) { - LOG_DBG("%p", tx); tx->cb = NULL; tx->user_data = NULL; tx->pending_no_cb = 0U; @@ -430,11 +427,25 @@ void bt_conn_recv(struct bt_conn *conn, struct net_buf *buf, uint8_t flags) static struct bt_conn_tx *conn_tx_alloc(void) { - struct bt_conn_tx *ret = k_fifo_get(&free_tx, K_NO_WAIT); + /* The TX context always get freed in the system workqueue, + * so if we're in the same workqueue but there are no immediate + * contexts available, there's no chance we'll get one by waiting. + */ + if (k_current_get() == &k_sys_work_q.thread) { + return k_fifo_get(&free_tx, K_NO_WAIT); + } + + if (IS_ENABLED(CONFIG_BT_CONN_LOG_LEVEL_DBG)) { + struct bt_conn_tx *tx = k_fifo_get(&free_tx, K_NO_WAIT); - LOG_DBG("%p", ret); + if (tx) { + return tx; + } - return ret; + LOG_WRN("Unable to get an immediate free conn_tx"); + } + + return k_fifo_get(&free_tx, K_FOREVER); } int bt_conn_send_iso_cb(struct bt_conn *conn, struct net_buf *buf, @@ -464,6 +475,8 @@ int bt_conn_send_iso_cb(struct bt_conn *conn, struct net_buf *buf, int bt_conn_send_cb(struct bt_conn *conn, struct net_buf *buf, bt_conn_tx_cb_t cb, void *user_data) { + struct bt_conn_tx *tx; + LOG_DBG("conn handle %u buf len %u cb %p user_data %p", conn->handle, buf->len, cb, user_data); @@ -478,10 +491,7 @@ int bt_conn_send_cb(struct bt_conn *conn, struct net_buf *buf, } if (buf->user_data_size < CONFIG_BT_CONN_TX_USER_DATA_SIZE) { - /* To find the pool: - * gdb --batch -ex 'b main' -ex 'r' -ex 'p net_buf_pool_get(pool_id)' - */ - LOG_ERR("not enough room in user_data %d < %d (pool id %u)", + LOG_ERR("not enough room in user_data %d < %d pool %u", buf->user_data_size, CONFIG_BT_CONN_TX_USER_DATA_SIZE, buf->pool_id); @@ -493,8 +503,29 @@ int bt_conn_send_cb(struct bt_conn *conn, struct net_buf *buf, return -ENOTCONN; } - tx_data(buf)->cb = cb; - tx_data(buf)->cb_user_data = user_data; + if (cb) { + tx = conn_tx_alloc(); + if (!tx) { + LOG_DBG("Unable to allocate TX context"); + return -ENOBUFS; + } + + /* Verify that we're still connected after blocking */ + if (conn->state != BT_CONN_CONNECTED) { + LOG_WRN("Disconnected while allocating context"); + tx_free(tx); + return -ENOTCONN; + } + + tx->cb = cb; + tx->user_data = user_data; + tx->pending_no_cb = 0U; + + tx_data(buf)->tx = tx; + } else { + tx_data(buf)->tx = NULL; + } + tx_data(buf)->is_cont = false; net_buf_put(&conn->tx_queue, buf); @@ -590,9 +621,9 @@ static inline uint16_t conn_mtu(struct bt_conn *conn) #endif /* CONFIG_BT_CONN */ } -static int do_send_frag(struct bt_conn *conn, struct net_buf *buf, uint8_t flags, - struct bt_conn_tx *tx) +static int do_send_frag(struct bt_conn *conn, struct net_buf *buf, uint8_t flags) { + struct bt_conn_tx *tx = tx_data(buf)->tx; uint32_t *pending_no_cb = NULL; unsigned int key; int err = 0; @@ -657,6 +688,7 @@ static int do_send_frag(struct bt_conn *conn, struct net_buf *buf, uint8_t flags /* `buf` might not get destroyed, and its `tx` pointer will still be reachable. * Make sure that we don't try to use the destroyed context later. */ + tx_data(buf)->tx = NULL; conn_tx_destroy(conn, tx); } @@ -667,8 +699,6 @@ static int send_frag(struct bt_conn *conn, struct net_buf *buf, struct net_buf *frag, uint8_t flags) { - struct bt_conn_tx *tx = NULL; - /* Check if the controller can accept ACL packets */ if (k_sem_take(bt_conn_get_pkts(conn), K_NO_WAIT)) { LOG_DBG("no controller bufs"); @@ -690,20 +720,6 @@ static int send_frag(struct bt_conn *conn, net_buf_add_mem(frag, buf->data, frag_len); net_buf_pull(buf, frag_len); } else { - if (tx_data(buf)->cb) { - tx = conn_tx_alloc(); - atomic_set_bit_to(conn->flags, BT_CONN_TX_WOULDBLOCK_FREE_TX, !tx); - if (!tx) { - LOG_DBG("No available tx context"); - k_sem_give(bt_conn_get_pkts(conn)); - return -EWOULDBLOCK; - } - - tx->cb = tx_data(buf)->cb; - tx->user_data = tx_data(buf)->cb_user_data; - tx->pending_no_cb = 0U; - } - /* De-queue the buffer now that we know we can send it. * Only applies if the buffer to be sent is the original buffer, * and not one of its fragments. @@ -713,7 +729,7 @@ static int send_frag(struct bt_conn *conn, frag = buf; } - return do_send_frag(conn, frag, flags, tx); + return do_send_frag(conn, frag, flags); } static struct net_buf *create_frag(struct bt_conn *conn, struct net_buf *buf) @@ -741,7 +757,7 @@ static struct net_buf *create_frag(struct bt_conn *conn, struct net_buf *buf) } /* Fragments never have a TX completion callback */ - tx_data(frag)->cb = NULL; + tx_data(frag)->tx = NULL; tx_data(frag)->is_cont = false; tx_data(frag)->iso_has_ts = tx_data(buf)->iso_has_ts; @@ -820,11 +836,17 @@ static void conn_cleanup(struct bt_conn *conn) /* Give back any allocated buffers */ while ((buf = net_buf_get(&conn->tx_queue, K_NO_WAIT))) { - bt_conn_tx_cb_t cb = tx_data(buf)->cb; - void *cb_user_data = tx_data(buf)->cb_user_data; + struct bt_conn_tx *tx = tx_data(buf)->tx; + + tx_data(buf)->tx = NULL; + /* destroy the buffer */ net_buf_unref(buf); - cb(conn, cb_user_data, -ESHUTDOWN); + + /* destroy the tx context (and any associated meta-data) */ + if (tx) { + conn_tx_destroy(conn, tx); + } } __ASSERT(sys_slist_is_empty(&conn->tx_pending), "Pending TX packets"); @@ -892,26 +914,15 @@ static int conn_prepare_events(struct bt_conn *conn, K_POLL_TYPE_SEM_AVAILABLE, K_POLL_MODE_NOTIFY_ONLY, conn_pkts); - } else if (atomic_test_bit(conn->flags, BT_CONN_TX_WOULDBLOCK_FREE_TX) && - k_fifo_is_empty(&free_tx)) { - LOG_DBG("wait on tx contexts"); - k_poll_event_init(&events[0], - K_POLL_TYPE_FIFO_DATA_AVAILABLE, - K_POLL_MODE_NOTIFY_ONLY, - &free_tx); - events[0].tag = BT_EVENT_CONN_FREE_TX; } else { - /* This must be the last thing to be waited on, since - * only this event triggers processing. - */ /* Wait until there is more data to send. */ LOG_DBG("wait on host fifo"); k_poll_event_init(&events[0], K_POLL_TYPE_FIFO_DATA_AVAILABLE, K_POLL_MODE_NOTIFY_ONLY, &conn->tx_queue); - events[0].tag = BT_EVENT_CONN_TX_QUEUE; } + events[0].tag = BT_EVENT_CONN_TX_QUEUE; return 0; } @@ -988,12 +999,17 @@ void bt_conn_process_tx(struct bt_conn *conn) * least tear down the connection. */ if (err == -EIO) { - bt_conn_tx_cb_t cb = tx_data(buf)->cb; - void *cb_user_data = tx_data(buf)->cb_user_data; + struct bt_conn_tx *tx = tx_data(buf)->tx; + + tx_data(buf)->tx = NULL; /* destroy the buffer */ net_buf_unref(buf); - cb(conn, cb_user_data, -ESHUTDOWN); + + /* destroy the tx context (and any associated meta-data) */ + if (tx) { + conn_tx_destroy(conn, tx); + } } } diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index 5a3f4789f03..f3cdeac265b 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -80,8 +80,6 @@ enum { BT_CONN_CTE_REQ_ENABLED, /* CTE request procedure is enabled */ BT_CONN_CTE_RSP_ENABLED, /* CTE response procedure is enabled */ - BT_CONN_TX_WOULDBLOCK_FREE_TX, /** #bt_conn_process_tx wouldblock on #free_tx */ - /* Total number of flags - must be at the end of the enum */ BT_CONN_NUM_FLAGS, }; diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index 147d90794eb..52387fa5712 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -26,7 +26,6 @@ enum { BT_EVENT_CMD_TX, BT_EVENT_CONN_TX_QUEUE, - BT_EVENT_CONN_FREE_TX, }; /* bt_dev flags: the flags defined here represent BT controller state */ From 9ed985968dc59a2dacf1128c9c2ddad1cdf13892 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 222/825] Revert "[nrf fromtree] Bluetooth: ISO: Avoid bt_iso_chan_disconnected in bt_iso_reset" This reverts commit 14bd7503d9b70bd66ac1f3ecdd7b2bd5112b12ae. --- subsys/bluetooth/host/iso.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c index e4dab861c2d..6df42691a28 100644 --- a/subsys/bluetooth/host/iso.c +++ b/subsys/bluetooth/host/iso.c @@ -3290,20 +3290,12 @@ void bt_iso_reset(void) #if defined(CONFIG_BT_ISO_CENTRAL) for (size_t i = 0U; i < ARRAY_SIZE(cigs); i++) { struct bt_iso_cig *cig = &cigs[i]; - struct bt_iso_chan *cis; + struct bt_iso_chan *cis, *tmp; - /* Disconnect any connected CIS and call the callback - * We cannot use bt_iso_chan_disconnected directly here, as that - * attempts to also remove the ISO data path, which we shouldn't attempt to - * during the reset, as that sends HCI commands. - */ - SYS_SLIST_FOR_EACH_CONTAINER(&cig->cis_channels, cis, node) { + /* Call the disconnected callback for each CIS that is no idle */ + SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&cig->cis_channels, cis, tmp, node) { if (cis->state != BT_ISO_STATE_DISCONNECTED) { - bt_iso_chan_set_state(cis, BT_ISO_STATE_DISCONNECTED); - bt_iso_cleanup_acl(cis->iso); - if (cis->ops != NULL && cis->ops->disconnected != NULL) { - cis->ops->disconnected(cis, BT_HCI_ERR_UNSPECIFIED); - } + bt_iso_chan_disconnected(cis, BT_HCI_ERR_UNSPECIFIED); } } From 7a61d04d98c6e319335cb6b4d057a60546c1240d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 223/825] Revert "[nrf fromtree] bluetooth: keys_br: Improve bt_foreach_bond" This reverts commit 45139fbfb8b9f5823eec36a2a958f5863a8da745. --- subsys/bluetooth/host/classic/keys_br.c | 18 ------------------ subsys/bluetooth/host/keys.c | 4 ---- subsys/bluetooth/host/keys.h | 3 +-- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/subsys/bluetooth/host/classic/keys_br.c b/subsys/bluetooth/host/classic/keys_br.c index 3c9536fe112..2ce745de678 100644 --- a/subsys/bluetooth/host/classic/keys_br.c +++ b/subsys/bluetooth/host/classic/keys_br.c @@ -146,24 +146,6 @@ void bt_keys_link_key_store(struct bt_keys_link_key *link_key) } } -void bt_foreach_bond_br(void (*func)(const struct bt_bond_info *info, void *user_data), - void *user_data) -{ - __ASSERT_NO_MSG(func != NULL); - - for (size_t i = 0; i < ARRAY_SIZE(key_pool); i++) { - const struct bt_keys_link_key *key = &key_pool[i]; - - if (!bt_addr_eq(&key->addr, BT_ADDR_ANY)) { - struct bt_bond_info info; - - info.addr.type = BT_ADDR_LE_PUBLIC; - bt_addr_copy(&info.addr.a, &key->addr); - func(&info, user_data); - } - } -} - #if defined(CONFIG_BT_SETTINGS) static int link_key_set(const char *name, size_t len_rd, diff --git a/subsys/bluetooth/host/keys.c b/subsys/bluetooth/host/keys.c index 6740d43b1cd..cde3824b302 100644 --- a/subsys/bluetooth/host/keys.c +++ b/subsys/bluetooth/host/keys.c @@ -174,10 +174,6 @@ void bt_foreach_bond(uint8_t id, void (*func)(const struct bt_bond_info *info, func(&info, user_data); } } - - if (IS_ENABLED(CONFIG_BT_CLASSIC)) { - bt_foreach_bond_br(func, user_data); - } } void bt_keys_foreach_type(enum bt_keys_type type, void (*func)(struct bt_keys *keys, void *data), diff --git a/subsys/bluetooth/host/keys.h b/subsys/bluetooth/host/keys.h index 76508e0cf39..c6389640e4d 100644 --- a/subsys/bluetooth/host/keys.h +++ b/subsys/bluetooth/host/keys.h @@ -221,8 +221,7 @@ struct bt_keys_link_key *bt_keys_find_link_key(const bt_addr_t *addr); void bt_keys_link_key_clear(struct bt_keys_link_key *link_key); void bt_keys_link_key_clear_addr(const bt_addr_t *addr); void bt_keys_link_key_store(struct bt_keys_link_key *link_key); -void bt_foreach_bond_br(void (*func)(const struct bt_bond_info *info, void *user_data), - void *user_data); + /* This function is used to signal that the key has been used for paring */ /* It updates the aging counter and saves it to flash if configuration option */ From 18cc6f83f4b0b9072a2026378076f6c03b42b74b Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 224/825] Revert "[nrf fromtree] dts: nordic: nrf54l15: Add mbox VEVIF nodes" This reverts commit d6e5642ee019e220c675edfb38200f74c6be93d1. --- dts/arm/nordic/nrf54l15_cpuapp.dtsi | 22 +------- dts/common/nordic/nrf54l15.dtsi | 50 +++++++++++++++++++ dts/riscv/nordic/nrf54l15_cpuflpr.dtsi | 29 +---------- .../nordic-flpr-xip/nordic-flpr-xip.overlay | 2 +- snippets/nordic-flpr/nordic-flpr.overlay | 2 +- 5 files changed, 54 insertions(+), 51 deletions(-) diff --git a/dts/arm/nordic/nrf54l15_cpuapp.dtsi b/dts/arm/nordic/nrf54l15_cpuapp.dtsi index bcc09da2556..b32b1eef73a 100644 --- a/dts/arm/nordic/nrf54l15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l15_cpuapp.dtsi @@ -9,6 +9,7 @@ cpu: &cpuapp {}; systick: &cpuapp_systick {}; nvic: &cpuapp_nvic {}; +cpuflpr_vevif: &cpuflpr_vevif_remote {}; /delete-node/ &cpuflpr; /delete-node/ &cpuflpr_rram; @@ -37,27 +38,6 @@ nvic: &cpuapp_nvic {}; 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 = <0x00008000>; - }; - - cpuapp_vevif_tx: mailbox@0 { - compatible = "nordic,nrf-vevif-task-tx"; - reg = <0x0 0x1000>; - #mbox-cells = <1>; - nordic,tasks = <7>; - nordic,tasks-mask = <0x0003f800>; - status = "disabled"; - }; -}; - &cpuapp_ppb { compatible = "simple-bus"; ranges; diff --git a/dts/common/nordic/nrf54l15.dtsi b/dts/common/nordic/nrf54l15.dtsi index df0a52639bb..122e4fdf42a 100644 --- a/dts/common/nordic/nrf54l15.dtsi +++ b/dts/common/nordic/nrf54l15.dtsi @@ -42,6 +42,47 @@ clock-frequency = ; riscv,isa = "rv32emc"; nordic,bus-width = <32>; + + cpuflpr_vevif_local: mailbox { + compatible = "nordic,nrf-vevif-local"; + status = "disabled"; + interrupt-parent = <&cpuflpr_clic>; + interrupts = <0 NRF_DEFAULT_IRQ_PRIORITY>, + <1 NRF_DEFAULT_IRQ_PRIORITY>, + <2 NRF_DEFAULT_IRQ_PRIORITY>, + <3 NRF_DEFAULT_IRQ_PRIORITY>, + <4 NRF_DEFAULT_IRQ_PRIORITY>, + <5 NRF_DEFAULT_IRQ_PRIORITY>, + <6 NRF_DEFAULT_IRQ_PRIORITY>, + <7 NRF_DEFAULT_IRQ_PRIORITY>, + <8 NRF_DEFAULT_IRQ_PRIORITY>, + <9 NRF_DEFAULT_IRQ_PRIORITY>, + <10 NRF_DEFAULT_IRQ_PRIORITY>, + <11 NRF_DEFAULT_IRQ_PRIORITY>, + <12 NRF_DEFAULT_IRQ_PRIORITY>, + <13 NRF_DEFAULT_IRQ_PRIORITY>, + <14 NRF_DEFAULT_IRQ_PRIORITY>, + <15 NRF_DEFAULT_IRQ_PRIORITY>, + <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>, + <23 NRF_DEFAULT_IRQ_PRIORITY>, + <24 NRF_DEFAULT_IRQ_PRIORITY>, + <25 NRF_DEFAULT_IRQ_PRIORITY>, + <26 NRF_DEFAULT_IRQ_PRIORITY>, + <27 NRF_DEFAULT_IRQ_PRIORITY>, + <28 NRF_DEFAULT_IRQ_PRIORITY>, + <29 NRF_DEFAULT_IRQ_PRIORITY>, + <30 NRF_DEFAULT_IRQ_PRIORITY>, + <31 NRF_DEFAULT_IRQ_PRIORITY>; + #mbox-cells = <1>; + nordic,tasks = <18>; + nordic,tasks-mask = <0x007f0000>; + }; }; }; @@ -145,6 +186,15 @@ #size-cells = <1>; status = "disabled"; + cpuflpr_vevif_remote: mailbox@0 { + compatible = "nordic,nrf-vevif-remote"; + reg = <0x0 0x1000>; + #mbox-cells = <1>; + nordic,tasks = <18>; + nordic,tasks-mask = <0x007f0000>; + status = "disabled"; + }; + cpuflpr_clic: interrupt-controller@f0000000 { compatible = "nordic,nrf-clic"; reg = <0xf0000000 0x1780>; diff --git a/dts/riscv/nordic/nrf54l15_cpuflpr.dtsi b/dts/riscv/nordic/nrf54l15_cpuflpr.dtsi index 0e4437a1884..14a92935f4a 100644 --- a/dts/riscv/nordic/nrf54l15_cpuflpr.dtsi +++ b/dts/riscv/nordic/nrf54l15_cpuflpr.dtsi @@ -8,6 +8,7 @@ cpu: &cpuflpr {}; clic: &cpuflpr_clic {}; +cpuflpr_vevif: &cpuflpr_vevif_local {}; /delete-node/ &cpuapp; /delete-node/ &cpuapp_rram; @@ -22,34 +23,6 @@ clic: &cpuflpr_clic {}; }; }; -&cpuflpr { - cpuflpr_vevif_rx: mailbox { - compatible = "nordic,nrf-vevif-task-rx"; - status = "disabled"; - interrupt-parent = <&cpuflpr_clic>; - interrupts = <11 NRF_DEFAULT_IRQ_PRIORITY>, - <12 NRF_DEFAULT_IRQ_PRIORITY>, - <13 NRF_DEFAULT_IRQ_PRIORITY>, - <14 NRF_DEFAULT_IRQ_PRIORITY>, - <15 NRF_DEFAULT_IRQ_PRIORITY>, - <16 NRF_DEFAULT_IRQ_PRIORITY>, - <17 NRF_DEFAULT_IRQ_PRIORITY>; - #mbox-cells = <1>; - nordic,tasks = <7>; - nordic,tasks-mask = <0x0003f800>; - }; -}; - -&cpuflpr_vpr { - cpuflpr_vevif_tx: mailbox { - compatible = "nordic,nrf-vevif-event-tx"; - #mbox-cells = <1>; - nordic,events = <1>; - nordic,events-mask = <0x00008000>; - status = "disabled"; - }; -}; - &cpuflpr_clic { status = "okay"; }; diff --git a/snippets/nordic-flpr-xip/nordic-flpr-xip.overlay b/snippets/nordic-flpr-xip/nordic-flpr-xip.overlay index ddfbc71857e..fc5e048ad5d 100644 --- a/snippets/nordic-flpr-xip/nordic-flpr-xip.overlay +++ b/snippets/nordic-flpr-xip/nordic-flpr-xip.overlay @@ -7,6 +7,6 @@ status = "okay"; }; -&cpuapp_vevif_tx { +&cpuflpr_vevif_remote { status = "okay"; }; diff --git a/snippets/nordic-flpr/nordic-flpr.overlay b/snippets/nordic-flpr/nordic-flpr.overlay index ddfbc71857e..fc5e048ad5d 100644 --- a/snippets/nordic-flpr/nordic-flpr.overlay +++ b/snippets/nordic-flpr/nordic-flpr.overlay @@ -7,6 +7,6 @@ status = "okay"; }; -&cpuapp_vevif_tx { +&cpuflpr_vevif_remote { status = "okay"; }; From 91d421ca41b1973f327f4fde6699267966d88a60 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 225/825] Revert "[nrf noup] dts: Add Bluetooth Controller to nRF54H20" This reverts commit 6e98fa9f52f03abae3354e1e2ed4064cf72f7e10. --- dts/arm/nordic/nrf54h20_cpurad.dtsi | 8 -------- dts/common/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 4a69438f83c..2af6070f046 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -21,10 +21,6 @@ wdt011: &cpurad_wdt011 {}; /delete-node/ &cpuppr; / { - chosen { - zephyr,bt-hci = &bt_hci_controller; - }; - soc { compatible = "simple-bus"; interrupt-parent = <&cpurad_nvic>; @@ -96,7 +92,3 @@ wdt011: &cpurad_wdt011 {}; &dppic020 { status = "okay"; }; - -&bt_hci_controller { - status = "okay"; -}; diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index f57296e5cd0..2ee655b76ab 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -316,14 +316,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 597c3b322c9c4ae86ad93c2b1d6ceb4914a96e1c Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:01 +0200 Subject: [PATCH 226/825] Revert "[nrf fromtree] modules: Add Kconfig to Kconfig.mcux for BLE support" This reverts commit 20de769e2704016ca088f925e37cb83f68e9e59f. --- modules/Kconfig.mcux | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/modules/Kconfig.mcux b/modules/Kconfig.mcux index 5d30250079f..0700438661e 100644 --- a/modules/Kconfig.mcux +++ b/modules/Kconfig.mcux @@ -369,16 +369,4 @@ config HAS_MCUX_XBARA help Set if the XBARA module is present on the SoC. -config NXP_FW_LOADER - bool "Include firmware loader component" - help - The firmware loader is used to load firmwares to embedded tranceivers. - It is needed to enable connectivity features. - -config NXP_RF_IMU - bool "Include RF_IMU adapter for intercore messaging" - select EVENTS - help - RF_IMU adapter is needed for intercore messaging. - endif # HAS_MCUX From d7dcfafd2bebfea2fe3d7cc9328738dfb1b6e585 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 227/825] Revert "[nrf fromtree] Bluetooth: drivers: Convert NXP HCI driver to new API" This reverts commit 035d45938f8725319da2a5025b4d692249249a45. --- drivers/bluetooth/hci/Kconfig | 2 - drivers/bluetooth/hci/hci_nxp.c | 51 +++++++------------ dts/arm/nxp/nxp_rw6xx_common.dtsi | 1 - .../{bluetooth => arm}/nxp,hci-ble.yaml | 6 +-- soc/nxp/rw/Kconfig.defconfig | 3 ++ 5 files changed, 22 insertions(+), 41 deletions(-) rename dts/bindings/{bluetooth => arm}/nxp,hci-ble.yaml (62%) diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index c5df8de9b1f..47b7cbf53b2 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -126,8 +126,6 @@ config BT_DA1469X config BT_NXP bool "NXP HCI driver" - default y - depends on DT_HAS_NXP_HCI_BLE_ENABLED select BT_HCI_SETUP help NXP HCI bluetooth interface diff --git a/drivers/bluetooth/hci/hci_nxp.c b/drivers/bluetooth/hci/hci_nxp.c index ff9d9628c16..293ba3cfff1 100644 --- a/drivers/bluetooth/hci/hci_nxp.c +++ b/drivers/bluetooth/hci/hci_nxp.c @@ -9,7 +9,7 @@ /* -------------------------------------------------------------------------- */ #include -#include +#include #include #include #include @@ -26,10 +26,6 @@ #define DT_DRV_COMPAT nxp_hci_ble -struct bt_nxp_data { - bt_hci_recv_t recv; -}; - #define LOG_LEVEL CONFIG_BT_HCI_DRIVER_LOG_LEVEL LOG_MODULE_REGISTER(bt_driver); @@ -248,8 +244,6 @@ static struct net_buf *bt_acl_recv(uint8_t *data, size_t len) static void hci_rx_cb(uint8_t packetType, uint8_t *data, uint16_t len) { - const struct device *dev = DEVICE_DT_GET(DT_DRV_INST(0)); - struct bt_nxp_data *hci = dev->data; struct net_buf *buf; switch (packetType) { @@ -268,16 +262,14 @@ static void hci_rx_cb(uint8_t packetType, uint8_t *data, uint16_t len) if (buf) { /* Provide the buffer to the host */ - hci->recv(dev, buf); + bt_recv(buf); } } -static int bt_nxp_send(const struct device *dev, struct net_buf *buf) +static int bt_nxp_send(struct net_buf *buf) { uint8_t packetType; - ARG_UNUSED(dev); - switch (bt_buf_get_type(buf)) { case BT_BUF_CMD: packetType = BT_HCI_H4_CMD; @@ -298,9 +290,8 @@ static int bt_nxp_send(const struct device *dev, struct net_buf *buf) return 0; } -static int bt_nxp_open(const struct device *dev, bt_hci_recv_t recv) +static int bt_nxp_open(void) { - struct bt_nxp_data *hci = dev->data; int ret = 0; do { @@ -321,16 +312,13 @@ static int bt_nxp_open(const struct device *dev, bt_hci_recv_t recv) LOG_ERR("HCI open failed"); break; } - - hci->recv = recv; } while (false); return ret; } -int bt_nxp_setup(const struct device *dev, const struct bt_hci_setup_params *params) +int bt_nxp_setup(const struct bt_hci_setup_params *params) { - ARG_UNUSED(dev); ARG_UNUSED(params); int ret; @@ -374,9 +362,8 @@ int bt_nxp_setup(const struct device *dev, const struct bt_hci_setup_params *par return ret; } -static int bt_nxp_close(const struct device *dev) +static int bt_nxp_close(void) { - struct bt_nxp_data *hci = dev->data; int ret = 0; /* Reset the Controller */ #if CONFIG_BT_HCI_HOST @@ -391,25 +378,23 @@ static int bt_nxp_close(const struct device *dev) LOG_ERR("Failed to shutdown BLE controller"); } #endif - hci->recv = NULL; - return ret; } -static const struct bt_hci_driver_api drv = { +static const struct bt_hci_driver drv = { + .name = "BT NXP", .open = bt_nxp_open, .setup = bt_nxp_setup, .close = bt_nxp_close, .send = bt_nxp_send, + .bus = BT_HCI_DRIVER_BUS_IPM, }; -static int bt_nxp_init(const struct device *dev) +static int bt_nxp_init(void) { int status; int ret = 0; - ARG_UNUSED(dev); - /* HCI Interrupt */ IRQ_CONNECT(HCI_IRQ_N, HCI_IRQ_P, ble_hci_handler, 0, 0); irq_enable(HCI_IRQ_N); @@ -429,16 +414,16 @@ static int bt_nxp_init(const struct device *dev) ret = status; break; } + + status = bt_hci_driver_register(&drv); + if (status < 0) { + LOG_ERR("HCI driver registration failed"); + ret = status; + break; + } } while (0); return ret; } -#define HCI_DEVICE_INIT(inst) \ - static struct bt_nxp_data hci_data_##inst = { \ - }; \ - DEVICE_DT_INST_DEFINE(inst, bt_nxp_init, NULL, &hci_data_##inst, NULL, \ - POST_KERNEL, CONFIG_BT_HCI_INIT_PRIORITY, &drv) - -/* Only one instance supported right now */ -HCI_DEVICE_INIT(0) +SYS_INIT(bt_nxp_init, POST_KERNEL, CONFIG_BT_HCI_INIT_PRIORITY); diff --git a/dts/arm/nxp/nxp_rw6xx_common.dtsi b/dts/arm/nxp/nxp_rw6xx_common.dtsi index 722c3a65c5e..60c3dc9d2d5 100644 --- a/dts/arm/nxp/nxp_rw6xx_common.dtsi +++ b/dts/arm/nxp/nxp_rw6xx_common.dtsi @@ -16,7 +16,6 @@ / { chosen { zephyr,entropy = &trng; - zephyr,bt-hci = &hci; }; cpus { diff --git a/dts/bindings/bluetooth/nxp,hci-ble.yaml b/dts/bindings/arm/nxp,hci-ble.yaml similarity index 62% rename from dts/bindings/bluetooth/nxp,hci-ble.yaml rename to dts/bindings/arm/nxp,hci-ble.yaml index f2c05c2fda1..7620ec8eb69 100644 --- a/dts/bindings/bluetooth/nxp,hci-ble.yaml +++ b/dts/bindings/arm/nxp,hci-ble.yaml @@ -5,12 +5,8 @@ description: NXP BLE HCI information compatible: "nxp,hci-ble" -include: bt-hci.yaml +include: base.yaml properties: interrupts: required: true - bt-hci-name: - default: "BT NXP" - bt-hci-bus: - default: "BT_HCI_BUS_IPM" diff --git a/soc/nxp/rw/Kconfig.defconfig b/soc/nxp/rw/Kconfig.defconfig index d2f1c8c24c7..aad74cce76e 100644 --- a/soc/nxp/rw/Kconfig.defconfig +++ b/soc/nxp/rw/Kconfig.defconfig @@ -85,6 +85,9 @@ if BT config FLASH default y +config BT_NXP + default y + config BT_DIS_MANUF default "NXP" From 8d34739259c08de7f3995225306d4f9056391dd4 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 228/825] Revert "[nrf fromtree] dts: binding: add yaml file for nxp HCI" This reverts commit 99b9a3b9829c59909a5e1637fb7c2fd5508a19a7. --- dts/bindings/arm/nxp,hci-ble.yaml | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 dts/bindings/arm/nxp,hci-ble.yaml diff --git a/dts/bindings/arm/nxp,hci-ble.yaml b/dts/bindings/arm/nxp,hci-ble.yaml deleted file mode 100644 index 7620ec8eb69..00000000000 --- a/dts/bindings/arm/nxp,hci-ble.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright 2023 NXP -# SPDX-License-Identifier: Apache-2.0 - -description: NXP BLE HCI information - -compatible: "nxp,hci-ble" - -include: base.yaml - -properties: - interrupts: - required: true From f4b4c3e8dfbc6e07dd8d43b00ccd22aa5eda1de1 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 229/825] Revert "[nrf fromtree] bluetooth: hci_nxp: move vendor specific setup to its dedicated place" This reverts commit 1e2a4a2241dbd3daca56b075eb54c43f558aac2c. --- drivers/bluetooth/hci/Kconfig | 1 - drivers/bluetooth/hci/hci_nxp.c | 14 +------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index 47b7cbf53b2..bc9810e7409 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -126,7 +126,6 @@ config BT_DA1469X config BT_NXP bool "NXP HCI driver" - select BT_HCI_SETUP help NXP HCI bluetooth interface diff --git a/drivers/bluetooth/hci/hci_nxp.c b/drivers/bluetooth/hci/hci_nxp.c index 293ba3cfff1..78016a794b5 100644 --- a/drivers/bluetooth/hci/hci_nxp.c +++ b/drivers/bluetooth/hci/hci_nxp.c @@ -312,18 +312,7 @@ static int bt_nxp_open(void) LOG_ERR("HCI open failed"); break; } - } while (false); - - return ret; -} - -int bt_nxp_setup(const struct bt_hci_setup_params *params) -{ - ARG_UNUSED(params); - - int ret; - do { #if CONFIG_HCI_NXP_SET_CAL_DATA ret = bt_nxp_set_calibration_data(); if (ret < 0) { @@ -356,7 +345,7 @@ int bt_nxp_setup(const struct bt_hci_setup_params *params) LOG_ERR("Failed to configure controller autosleep"); break; } -#endif /* CONFIG_HCI_NXP_ENABLE_AUTO_SLEEP */ +#endif } while (false); return ret; @@ -384,7 +373,6 @@ static int bt_nxp_close(void) static const struct bt_hci_driver drv = { .name = "BT NXP", .open = bt_nxp_open, - .setup = bt_nxp_setup, .close = bt_nxp_close, .send = bt_nxp_send, .bus = BT_HCI_DRIVER_BUS_IPM, From 57df7d055ce9f1ea23045494d1cf0465bd5bc71f Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 230/825] Revert "[nrf fromtree] Bluetooth: Controller: Clarify that it can be overridden out of tree" This reverts commit 24de8e1f32f861b5b4d628fe4e857a406c37dad8. --- dts/arm/nordic/nrf52805.dtsi | 3 --- dts/arm/nordic/nrf52810.dtsi | 3 --- dts/arm/nordic/nrf52811.dtsi | 3 --- dts/arm/nordic/nrf52820.dtsi | 3 --- dts/arm/nordic/nrf52832.dtsi | 3 --- dts/arm/nordic/nrf52833.dtsi | 3 --- dts/arm/nordic/nrf52840.dtsi | 3 --- dts/arm/nordic/nrf5340_cpunet.dtsi | 3 --- dts/common/nordic/nrf54l15.dtsi | 3 --- subsys/bluetooth/controller/Kconfig | 3 --- 10 files changed, 30 deletions(-) diff --git a/dts/arm/nordic/nrf52805.dtsi b/dts/arm/nordic/nrf52805.dtsi index 36213c18652..b375ef17069 100644 --- a/dts/arm/nordic/nrf52805.dtsi +++ b/dts/arm/nordic/nrf52805.dtsi @@ -88,9 +88,6 @@ 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_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "okay"; diff --git a/dts/arm/nordic/nrf52810.dtsi b/dts/arm/nordic/nrf52810.dtsi index 18b2e430943..0c95fe96e70 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -92,9 +92,6 @@ 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_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "okay"; diff --git a/dts/arm/nordic/nrf52811.dtsi b/dts/arm/nordic/nrf52811.dtsi index 12615364cef..2176bfa93c7 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.dtsi @@ -104,9 +104,6 @@ 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 = "okay"; diff --git a/dts/arm/nordic/nrf52820.dtsi b/dts/arm/nordic/nrf52820.dtsi index 21bb88aa99c..d6bd6e65f66 100644 --- a/dts/arm/nordic/nrf52820.dtsi +++ b/dts/arm/nordic/nrf52820.dtsi @@ -100,9 +100,6 @@ status = "disabled"; }; - /* 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 = "okay"; diff --git a/dts/arm/nordic/nrf52832.dtsi b/dts/arm/nordic/nrf52832.dtsi index f467c5fc5c0..bdb76a05d5b 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -92,9 +92,6 @@ 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_controller: bt_hci_controller { compatible = "zephyr,bt-hci-ll-sw-split"; status = "okay"; diff --git a/dts/arm/nordic/nrf52833.dtsi b/dts/arm/nordic/nrf52833.dtsi index 1a27a14447b..40c3f1efcad 100644 --- a/dts/arm/nordic/nrf52833.dtsi +++ b/dts/arm/nordic/nrf52833.dtsi @@ -99,9 +99,6 @@ 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 = "okay"; diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index a808e59afcf..58e746ac406 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -94,9 +94,6 @@ 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 = "okay"; diff --git a/dts/arm/nordic/nrf5340_cpunet.dtsi b/dts/arm/nordic/nrf5340_cpunet.dtsi index 77b77759b22..4e05f4a1df0 100644 --- a/dts/arm/nordic/nrf5340_cpunet.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet.dtsi @@ -102,9 +102,6 @@ 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 = "okay"; diff --git a/dts/common/nordic/nrf54l15.dtsi b/dts/common/nordic/nrf54l15.dtsi index 122e4fdf42a..8896b94f874 100644 --- a/dts/common/nordic/nrf54l15.dtsi +++ b/dts/common/nordic/nrf54l15.dtsi @@ -265,9 +265,6 @@ 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/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 46910626994..e791f79c537 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -122,9 +122,6 @@ choice BT_LL_CHOICE prompt "Bluetooth Link Layer Selection" help Select the Bluetooth Link Layer to compile. - The link layer choice list can be extended out of tree. - In the nRF Connect SDK, the SoftDevice Controller is selected - and set as the default Bluetooth Controller. config BT_LL_SW_SPLIT bool "Software-based BLE Link Layer [EXPERIMENTAL]" From db481d819b6158384d682aa6059a9eb853653684 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 231/825] Revert "[nrf fromtree] Bluetooth: drivers: Convert DA1469X HCI driver to new API" This reverts commit 346c39d90cc895f0642c9880e9befc6e351f5237. --- .../renesas/da1469x_dk_pro/Kconfig.defconfig | 3 ++ .../renesas/da1469x_dk_pro/da1469x_dk_pro.dts | 5 -- drivers/bluetooth/hci/Kconfig | 2 - drivers/bluetooth/hci/hci_da1469x.c | 47 ++++++------------- dts/arm/renesas/smartbond/da1469x.dtsi | 5 -- .../bluetooth/renesas,bt-hci-da1469x.yaml | 11 ----- 6 files changed, 17 insertions(+), 56 deletions(-) delete mode 100644 dts/bindings/bluetooth/renesas,bt-hci-da1469x.yaml diff --git a/boards/renesas/da1469x_dk_pro/Kconfig.defconfig b/boards/renesas/da1469x_dk_pro/Kconfig.defconfig index 5590a9550e4..6b07a144f64 100644 --- a/boards/renesas/da1469x_dk_pro/Kconfig.defconfig +++ b/boards/renesas/da1469x_dk_pro/Kconfig.defconfig @@ -50,6 +50,9 @@ config SERIAL_INIT_PRIORITY if BT +config BT_DA1469X + default y + config BT_WAIT_NOP default y diff --git a/boards/renesas/da1469x_dk_pro/da1469x_dk_pro.dts b/boards/renesas/da1469x_dk_pro/da1469x_dk_pro.dts index 4691a206f57..f4a3d1d674e 100644 --- a/boards/renesas/da1469x_dk_pro/da1469x_dk_pro.dts +++ b/boards/renesas/da1469x_dk_pro/da1469x_dk_pro.dts @@ -19,7 +19,6 @@ zephyr,console = &uart; zephyr,shell-uart = &uart; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &bt_hci_da1469x; }; lvgl_pointer { @@ -174,7 +173,3 @@ zephyr_udc0: &usbd { pinctrl-0 = <&spi2_controller>; pinctrl-names = "default"; }; - -&bt_hci_da1469x { - status = "okay"; -}; diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index bc9810e7409..031713139ac 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -118,8 +118,6 @@ config BT_PSOC6_BLESS config BT_DA1469X bool "DA1469x HCI driver" - default y - depends on DT_HAS_RENESAS_BT_HCI_DA1469X_ENABLED help Bluetooth HCI driver for communication with CMAC core on DA1469x MCU. diff --git a/drivers/bluetooth/hci/hci_da1469x.c b/drivers/bluetooth/hci/hci_da1469x.c index 96eb02db6d9..8935244472a 100644 --- a/drivers/bluetooth/hci/hci_da1469x.c +++ b/drivers/bluetooth/hci/hci_da1469x.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -26,12 +26,6 @@ LOG_MODULE_REGISTER(hci_da1469x); -#define DT_DRV_COMPAT renesas_bt_hci_da1469x - -struct hci_data { - bt_hci_recv_t recv; -}; - static K_KERNEL_STACK_DEFINE(rng_thread_stack, CONFIG_BT_RX_STACK_SIZE); static struct k_thread rng_thread_data; struct k_sem rng_sem; @@ -195,10 +189,9 @@ static struct net_buf *get_rx(k_timeout_t timeout) static void rx_thread(void *p1, void *p2, void *p3) { - const struct device *dev = p1; - struct hci_data *hci = dev->data; struct net_buf *buf; + ARG_UNUSED(p1); ARG_UNUSED(p2); ARG_UNUSED(p3); @@ -231,7 +224,7 @@ static void rx_thread(void *p1, void *p2, void *p3) irq_enable(CMAC2SYS_IRQn); LOG_DBG("Calling bt_recv(%p)", buf); - hci->recv(dev, buf); + bt_recv(buf); /* Give other threads a chance to run if the ISR * is receiving data so fast that rx.fifo never @@ -410,14 +403,13 @@ static void rng_thread(void *p1, void *p2, void *p3) } } -static int bt_da1469x_open(const struct device *dev, bt_hci_recv_t recv) +static int bt_da1469x_open(void) { - struct hci_data *hci = dev->data; k_tid_t tid; tid = k_thread_create(&rx_thread_data, rx_thread_stack, K_KERNEL_STACK_SIZEOF(rx_thread_stack), - rx_thread, (void *)dev, NULL, NULL, + rx_thread, NULL, NULL, NULL, K_PRIO_COOP(CONFIG_BT_RX_PRIO), 0, K_NO_WAIT); k_thread_name_set(tid, "bt_rx_thread"); @@ -431,8 +423,6 @@ static int bt_da1469x_open(const struct device *dev, bt_hci_recv_t recv) 0, K_NO_WAIT); k_thread_name_set(tid, "bt_rng_thread"); - hci->recv = recv; - cmac_enable(); irq_enable(CMAC2SYS_IRQn); @@ -440,23 +430,17 @@ static int bt_da1469x_open(const struct device *dev, bt_hci_recv_t recv) } #ifdef CONFIG_BT_HCI_HOST -static int bt_da1469x_close(const struct device *dev) +static int bt_da1469x_close(void) { - struct hci_data *hci = dev->data; - irq_disable(CMAC2SYS_IRQn); cmac_disable(); - hci->recv = NULL; - return 0; } #endif /* CONFIG_BT_HCI_HOST */ -static int bt_da1469x_send(const struct device *dev, struct net_buf *buf) +static int bt_da1469x_send(struct net_buf *buf) { - ARG_UNUSED(dev); - switch (bt_buf_get_type(buf)) { case BT_BUF_ACL_OUT: LOG_DBG("ACL: buf %p type %u len %u", buf, bt_buf_get_type(buf), buf->len); @@ -478,16 +462,20 @@ static int bt_da1469x_send(const struct device *dev, struct net_buf *buf) return 0; } -static const struct bt_hci_driver_api drv = { +static const struct bt_hci_driver drv = { + .name = "BT DA1469x", + .bus = BT_HCI_DRIVER_BUS_IPM, .open = bt_da1469x_open, .close = bt_da1469x_close, .send = bt_da1469x_send, }; -static int bt_da1469x_init(const struct device *dev) +static int bt_da1469x_init(void) { irq_disable(CMAC2SYS_IRQn); + bt_hci_driver_register(&drv); + cmac_disable(); cmac_load_image(); cmac_configure_pdc(); @@ -498,11 +486,4 @@ static int bt_da1469x_init(const struct device *dev) return 0; } -#define HCI_DEVICE_INIT(inst) \ - static struct hci_data hci_data_##inst = { \ - }; \ - DEVICE_DT_INST_DEFINE(inst, bt_da1469x_init, NULL, &hci_data_##inst, NULL, \ - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &drv) - -/* Only one instance supported right now */ -HCI_DEVICE_INIT(0) +SYS_INIT(bt_da1469x_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/dts/arm/renesas/smartbond/da1469x.dtsi b/dts/arm/renesas/smartbond/da1469x.dtsi index cff8b677fa3..fe589f52fb1 100644 --- a/dts/arm/renesas/smartbond/da1469x.dtsi +++ b/dts/arm/renesas/smartbond/da1469x.dtsi @@ -393,11 +393,6 @@ reg = <0x34000000 0x48>; status = "disabled"; }; - - bt_hci_da1469x: bt_hci_da1469x { - compatible = "renesas,bt-hci-da1469x"; - status = "disabled"; - }; }; }; diff --git a/dts/bindings/bluetooth/renesas,bt-hci-da1469x.yaml b/dts/bindings/bluetooth/renesas,bt-hci-da1469x.yaml deleted file mode 100644 index cd66b011953..00000000000 --- a/dts/bindings/bluetooth/renesas,bt-hci-da1469x.yaml +++ /dev/null @@ -1,11 +0,0 @@ -description: Bluetooth HCI for Renesas DA1469x - -compatible: "renesas,bt-hci-da1469x" - -include: bt-hci.yaml - -properties: - bt-hci-name: - default: "BT DA1469x" - bt-hci-bus: - default: "BT_HCI_BUS_IPM" From 2902cf5365919b584ebb7a2ff663aa261bfcb108 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 232/825] Revert "[nrf fromtree] Bluetooth: drivers: Convert STM32 IPM driver to new API" This reverts commit 62c988c1bf01bcf79839eb118b16db06953541f0. --- drivers/bluetooth/hci/Kconfig | 2 - drivers/bluetooth/hci/ipm_stm32wb.c | 48 ++++++------------- dts/arm/st/wb/stm32wb.dtsi | 1 - dts/bindings/bluetooth/st,stm32wb-ble-rf.yaml | 10 ++-- 4 files changed, 18 insertions(+), 43 deletions(-) diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index 031713139ac..3851667ca54 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -59,8 +59,6 @@ config BT_SPI config BT_STM32_IPM bool "IPM HCI" - default y - depends on DT_HAS_ST_STM32WB_RF_ENABLED select USE_STM32_HAL_CORTEX select HAS_STM32LIB help diff --git a/drivers/bluetooth/hci/ipm_stm32wb.c b/drivers/bluetooth/hci/ipm_stm32wb.c index df83ee36d54..48c5dd0a99c 100644 --- a/drivers/bluetooth/hci/ipm_stm32wb.c +++ b/drivers/bluetooth/hci/ipm_stm32wb.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include @@ -21,11 +21,7 @@ #include "shci.h" #include "shci_tl.h" -struct hci_data { - bt_hci_recv_t recv; -}; - -static const struct stm32_pclken clk_cfg[] = STM32_DT_CLOCKS(DT_DRV_INST(0)); +static const struct stm32_pclken clk_cfg[] = STM32_DT_CLOCKS(DT_NODELABEL(ble_rf)); #define POOL_SIZE (CFG_TLBLE_EVT_QUEUE_LENGTH * 4 * \ DIVC((sizeof(TL_PacketHeader_t) + TL_BLE_EVENT_FRAME_SIZE), 4)) @@ -160,9 +156,7 @@ void TM_EvtReceivedCb(TL_EvtPacket_t *hcievt) static void bt_ipm_rx_thread(void *p1, void *p2, void *p3) { - const struct device *dev = p1; - struct hci_data *hci = dev->data; - + ARG_UNUSED(p1); ARG_UNUSED(p2); ARG_UNUSED(p3); @@ -251,7 +245,7 @@ static void bt_ipm_rx_thread(void *p1, void *p2, void *p3) TL_MM_EvtDone(hcievt); - hci->recv(dev, buf); + bt_recv(buf); end_loop: k_sem_give(&ipm_busy); } @@ -353,12 +347,10 @@ void transport_init(void) TL_Enable(); } -static int bt_ipm_send(const struct device *dev, struct net_buf *buf) +static int bt_ipm_send(struct net_buf *buf) { TL_CmdPacket_t *ble_cmd_buff = &BleCmdBuffer; - ARG_UNUSED(dev); - k_sem_take(&ipm_busy, K_FOREVER); switch (bt_buf_get_type(buf)) { @@ -542,9 +534,8 @@ static int c2_reset(void) return 0; } -static int bt_ipm_open(const struct device *dev, bt_hci_recv_t recv) +static int bt_ipm_open(void) { - struct hci_data *hci = dev->data; int err; if (!c2_started_flag) { @@ -562,7 +553,7 @@ static int bt_ipm_open(const struct device *dev, bt_hci_recv_t recv) /* Start RX thread */ k_thread_create(&ipm_rx_thread_data, ipm_rx_stack, K_KERNEL_STACK_SIZEOF(ipm_rx_stack), - bt_ipm_rx_thread, (void *)dev, NULL, NULL, + bt_ipm_rx_thread, NULL, NULL, NULL, K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO), 0, K_NO_WAIT); @@ -573,17 +564,14 @@ static int bt_ipm_open(const struct device *dev, bt_hci_recv_t recv) } #endif /* CONFIG_BT_HCI_HOST */ - hci->recv = recv; - LOG_DBG("IPM Channel Open Completed"); return 0; } #ifdef CONFIG_BT_HCI_HOST -static int bt_ipm_close(const struct device *dev) +static int bt_ipm_close(void) { - struct hci_data *hci = dev->data; int err; struct net_buf *rsp; @@ -602,15 +590,15 @@ static int bt_ipm_close(const struct device *dev) k_thread_abort(&ipm_rx_thread_data); - hci->recv = NULL; - LOG_DBG("IPM Channel Close Completed"); return err; } #endif /* CONFIG_BT_HCI_HOST */ -static const struct bt_hci_driver_api drv = { +static const struct bt_hci_driver drv = { + .name = "BT IPM", + .bus = BT_HCI_DRIVER_BUS_IPM, .open = bt_ipm_open, #ifdef CONFIG_BT_HCI_HOST .close = bt_ipm_close, @@ -618,11 +606,12 @@ static const struct bt_hci_driver_api drv = { .send = bt_ipm_send, }; -static int _bt_ipm_init(const struct device *dev) +static int _bt_ipm_init(void) { int err; - ARG_UNUSED(dev); + + bt_hci_driver_register(&drv); err = c2_reset(); if (err) { @@ -632,11 +621,4 @@ static int _bt_ipm_init(const struct device *dev) return 0; } -#define HCI_DEVICE_INIT(inst) \ - static struct hci_data hci_data_##inst = { \ - }; \ - DEVICE_DT_INST_DEFINE(inst, _bt_ipm_init, NULL, &hci_data_##inst, NULL, \ - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &drv) - -/* Only one instance supported right now */ -HCI_DEVICE_INIT(0) +SYS_INIT(_bt_ipm_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/dts/arm/st/wb/stm32wb.dtsi b/dts/arm/st/wb/stm32wb.dtsi index 5cdb71b2aa7..acd8d3c0fd8 100644 --- a/dts/arm/st/wb/stm32wb.dtsi +++ b/dts/arm/st/wb/stm32wb.dtsi @@ -22,7 +22,6 @@ chosen { zephyr,entropy = &rng; zephyr,flash-controller = &flash; - zephyr,bt-hci = &ble_rf; }; cpus { diff --git a/dts/bindings/bluetooth/st,stm32wb-ble-rf.yaml b/dts/bindings/bluetooth/st,stm32wb-ble-rf.yaml index f1903de6840..51b46cbff17 100644 --- a/dts/bindings/bluetooth/st,stm32wb-ble-rf.yaml +++ b/dts/bindings/bluetooth/st,stm32wb-ble-rf.yaml @@ -6,12 +6,8 @@ description: | compatible: "st,stm32wb-rf" -include: bt-hci.yaml +include: base.yaml properties: - clocks: - required: true - bt-hci-name: - default: "BT IPM" - bt-hci-bus: - default: "BT_HCI_BUS_IPM" + clocks: + required: true From 6dd40e45bcff09e038bef2fd00433df7f85e82f4 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 233/825] Revert "[nrf fromtree] Bluetooth: drivers: Convert ST STM32WBA driver to new API" This reverts commit 7108d1d9afca5bbaf59ac6345ece0a8d74b0a1ef. --- drivers/bluetooth/hci/Kconfig | 2 - drivers/bluetooth/hci/hci_stm32wba.c | 47 ++++++++------------- dts/arm/st/wba/stm32wba.dtsi | 6 --- dts/bindings/bluetooth/st,hci-stm32wba.yaml | 11 ----- soc/st/stm32/stm32wbax/Kconfig.defconfig | 4 ++ 5 files changed, 22 insertions(+), 48 deletions(-) delete mode 100644 dts/bindings/bluetooth/st,hci-stm32wba.yaml diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index 3851667ca54..cf04e373d1b 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -66,8 +66,6 @@ config BT_STM32_IPM config BT_STM32WBA bool "STM32WBA HCI driver" - default y - depends on DT_HAS_ST_HCI_STM32WBA_ENABLED select HAS_STM32LIB help ST STM32WBA HCI Bluetooth interface diff --git a/drivers/bluetooth/hci/hci_stm32wba.c b/drivers/bluetooth/hci/hci_stm32wba.c index 03daed63b04..67b87a5aa25 100644 --- a/drivers/bluetooth/hci/hci_stm32wba.c +++ b/drivers/bluetooth/hci/hci_stm32wba.c @@ -7,10 +7,11 @@ * SPDX-License-Identifier: Apache-2.0 */ + #include #include #include -#include +#include #include #include #include @@ -26,12 +27,6 @@ #include LOG_MODULE_REGISTER(hci_wba); -#define DT_DRV_COMPAT st_hci_stm32wba - -struct hci_data { - bt_hci_recv_t recv; -}; - static K_SEM_DEFINE(hci_sem, 1, 1); #define BLE_CTRLR_STACK_BUFFER_SIZE 300 @@ -210,10 +205,9 @@ static struct net_buf *treat_iso(const uint8_t *data, size_t len, return buf; } -static int receive_data(const struct device *dev, const uint8_t *data, size_t len, +static int receive_data(const uint8_t *data, size_t len, const uint8_t *ext_data, size_t ext_len) { - struct hci_data *hci = dev->data; uint8_t pkt_indicator; struct net_buf *buf; int err = 0; @@ -241,7 +235,7 @@ static int receive_data(const struct device *dev, const uint8_t *data, size_t le } if (buf) { - hci->recv(dev, buf); + bt_recv(buf); } else { err = -ENOMEM; ll_state_busy = 1; @@ -253,7 +247,6 @@ static int receive_data(const struct device *dev, const uint8_t *data, size_t le uint8_t BLECB_Indication(const uint8_t *data, uint16_t length, const uint8_t *ext_data, uint16_t ext_length) { - const struct device *dev = DEVICE_DT_GET(DT_DRV_INST(0)); int ret = 0; int err; @@ -264,7 +257,7 @@ uint8_t BLECB_Indication(const uint8_t *data, uint16_t length, k_sem_take(&hci_sem, K_FOREVER); - err = receive_data(dev, data, (size_t)length - 1, + err = receive_data(data, (size_t)length - 1, ext_data, (size_t)ext_length); k_sem_give(&hci_sem); @@ -278,14 +271,12 @@ uint8_t BLECB_Indication(const uint8_t *data, uint16_t length, return ret; } -static int bt_hci_stm32wba_send(const struct device *dev, struct net_buf *buf) +static int bt_hci_stm32wba_send(struct net_buf *buf) { uint16_t event_length; uint8_t pkt_indicator; uint8_t tx_buffer[BLE_CTRLR_STACK_BUFFER_SIZE]; - ARG_UNUSED(dev); - k_sem_take(&hci_sem, K_FOREVER); LOG_DBG("buf %p type %u len %u", buf, bt_buf_get_type(buf), buf->len); @@ -313,7 +304,7 @@ static int bt_hci_stm32wba_send(const struct device *dev, struct net_buf *buf) LOG_DBG("event_length: %u", event_length); if (event_length) { - receive_data(dev, (uint8_t *)&tx_buffer, (size_t)event_length, NULL, 0); + receive_data((uint8_t *)&tx_buffer, (size_t)event_length, NULL, 0); } k_sem_give(&hci_sem); @@ -351,9 +342,8 @@ static int bt_ble_ctlr_init(void) return 0; } -static int bt_hci_stm32wba_open(const struct device *dev, bt_hci_recv_t recv) +static int bt_hci_stm32wba_open(void) { - struct hci_data *data = dev->data; int ret = 0; link_layer_register_isr(); @@ -361,9 +351,6 @@ static int bt_hci_stm32wba_open(const struct device *dev, bt_hci_recv_t recv) ll_sys_config_params(); ret = bt_ble_ctlr_init(); - if (ret == 0) { - data->recv = recv; - } /* TODO. Enable Flash manager once available */ if (IS_ENABLED(CONFIG_FLASH)) { @@ -373,16 +360,18 @@ static int bt_hci_stm32wba_open(const struct device *dev, bt_hci_recv_t recv) return ret; } -static const struct bt_hci_driver_api drv = { +static const struct bt_hci_driver drv = { + .name = "BT IPM", + .bus = BT_HCI_DRIVER_BUS_IPM, .open = bt_hci_stm32wba_open, .send = bt_hci_stm32wba_send, }; -#define HCI_DEVICE_INIT(inst) \ - static struct hci_data hci_data_##inst = { \ - }; \ - DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &hci_data_##inst, NULL, \ - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &drv) +static int bt_stm32wba_hci_init(void) +{ + bt_hci_driver_register(&drv); + + return 0; +} -/* Only one instance supported */ -HCI_DEVICE_INIT(0) +SYS_INIT(bt_stm32wba_hci_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/dts/arm/st/wba/stm32wba.dtsi b/dts/arm/st/wba/stm32wba.dtsi index 5b402ae9501..05efb0a9431 100644 --- a/dts/arm/st/wba/stm32wba.dtsi +++ b/dts/arm/st/wba/stm32wba.dtsi @@ -23,7 +23,6 @@ zephyr,entropy = &rng; zephyr,flash-controller = &flash; st,lptim-stdby-timer = &rtc; - zephyr,bt-hci = &bt_hci_wba; }; cpus { @@ -473,11 +472,6 @@ }; }; - bt_hci_wba: bt_hci_wba { - compatible = "st,hci-stm32wba"; - status = "okay"; - }; - swj_port: swj_port { compatible = "swj-connector"; pinctrl-0 = <&debug_jtms_swdio_pa13 &debug_jtck_swclk_pa14 diff --git a/dts/bindings/bluetooth/st,hci-stm32wba.yaml b/dts/bindings/bluetooth/st,hci-stm32wba.yaml deleted file mode 100644 index ea7c8dbbcc7..00000000000 --- a/dts/bindings/bluetooth/st,hci-stm32wba.yaml +++ /dev/null @@ -1,11 +0,0 @@ -description: Bluetooth HCI driver for ST STM32WBA - -compatible: "st,hci-stm32wba" - -include: bt-hci.yaml - -properties: - bt-hci-name: - default: "BT IPM" - bt-hci-bus: - default: "BT_HCI_BUS_IPM" diff --git a/soc/st/stm32/stm32wbax/Kconfig.defconfig b/soc/st/stm32/stm32wbax/Kconfig.defconfig index 7161241dc45..814d60428d7 100644 --- a/soc/st/stm32/stm32wbax/Kconfig.defconfig +++ b/soc/st/stm32/stm32wbax/Kconfig.defconfig @@ -13,6 +13,10 @@ config STM32_LPTIM_TIMER config STM32_FLASH_PREFETCH default y +config BT_STM32WBA + depends on BT + default y + config BT_STM32WBA select DYNAMIC_INTERRUPTS select DYNAMIC_DIRECT_INTERRUPTS From d713a9414354f949f52dcd2fbb348c1008f35f31 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 234/825] Revert "[nrf fromtree] Bluetooth: drivers: Convert SPI drivers to use new HCI API" This reverts commit fe93e990c39e8965e368145fca9797c322f7098c. --- .../carbon/96b_carbon_stm32f401xe.dts | 3 +- .../x_nucleo_bnrg2a1/x_nucleo_bnrg2a1.overlay | 8 +--- .../x_nucleo_idb05a1/x_nucleo_idb05a1.overlay | 6 --- boards/st/b_l4s5i_iot01a/b_l4s5i_iot01a.dts | 3 +- boards/st/disco_l475_iot1/disco_l475_iot1.dts | 3 +- boards/st/sensortile_box/sensortile_box.dts | 1 - .../sensortile_box_pro/sensortile_box_pro.dts | 3 +- boards/st/steval_stwinbx1/steval_stwinbx1.dts | 4 +- .../stm32l562e_dk/stm32l562e_dk_common.dtsi | 6 +-- drivers/bluetooth/hci/hci_spi_st.c | 43 +++++++------------ drivers/bluetooth/hci/spi.c | 42 ++++++------------ dts/bindings/bluetooth/st,hci-spi-v1.yaml | 4 -- dts/bindings/bluetooth/st,hci-spi-v2.yaml | 4 -- dts/bindings/bluetooth/zephyr,bt-hci-spi.yaml | 8 +--- 14 files changed, 38 insertions(+), 100 deletions(-) diff --git a/boards/96boards/carbon/96b_carbon_stm32f401xe.dts b/boards/96boards/carbon/96b_carbon_stm32f401xe.dts index 4f2365f303e..d94c67dc79d 100644 --- a/boards/96boards/carbon/96b_carbon_stm32f401xe.dts +++ b/boards/96boards/carbon/96b_carbon_stm32f401xe.dts @@ -20,7 +20,6 @@ zephyr,sram = &sram0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &hci_spi; }; leds { @@ -125,7 +124,7 @@ pinctrl-names = "default"; /* Nordic nRF51822-QFAC */ - hci_spi: bt-hci@0 { + bt-hci@0 { compatible = "zephyr,bt-hci-spi"; reg = <0>; reset-gpios = <&gpiob 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; diff --git a/boards/shields/x_nucleo_bnrg2a1/x_nucleo_bnrg2a1.overlay b/boards/shields/x_nucleo_bnrg2a1/x_nucleo_bnrg2a1.overlay index 535373ea307..177ac9eb948 100644 --- a/boards/shields/x_nucleo_bnrg2a1/x_nucleo_bnrg2a1.overlay +++ b/boards/shields/x_nucleo_bnrg2a1/x_nucleo_bnrg2a1.overlay @@ -4,16 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ - / { - chosen { - zephyr,bt-hci = &hci_spi; - }; - }; - &arduino_spi { cs-gpios = <&arduino_header 1 GPIO_ACTIVE_LOW>; /* A1 */ - hci_spi: bluenrg-2@0 { + bluenrg-2@0 { compatible = "st,hci-spi-v2"; reg = <0>; reset-gpios = <&arduino_header 13 GPIO_ACTIVE_LOW>; /* D7 */ diff --git a/boards/shields/x_nucleo_idb05a1/x_nucleo_idb05a1.overlay b/boards/shields/x_nucleo_idb05a1/x_nucleo_idb05a1.overlay index f508f0b26a0..e6dff3c9c9f 100644 --- a/boards/shields/x_nucleo_idb05a1/x_nucleo_idb05a1.overlay +++ b/boards/shields/x_nucleo_idb05a1/x_nucleo_idb05a1.overlay @@ -4,12 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - / { - chosen { - zephyr,bt-hci = &spbtle_rf_x_nucleo_idb05a1; - }; - }; - &arduino_spi { cs-gpios = <&arduino_header 1 GPIO_ACTIVE_LOW>; /* A1 */ diff --git a/boards/st/b_l4s5i_iot01a/b_l4s5i_iot01a.dts b/boards/st/b_l4s5i_iot01a/b_l4s5i_iot01a.dts index 13cd97c67be..531c5a5b20d 100644 --- a/boards/st/b_l4s5i_iot01a/b_l4s5i_iot01a.dts +++ b/boards/st/b_l4s5i_iot01a/b_l4s5i_iot01a.dts @@ -22,7 +22,6 @@ zephyr,code-partition = &slot0_partition; zephyr,flash-controller = &mx25r6435f; zephyr,bt-c2h-uart = &usart1; - zephyr,bt-hci = &hci_spi; }; leds { @@ -153,7 +152,7 @@ cs-gpios = <&gpiod 13 GPIO_ACTIVE_LOW>, <&gpioe 0 GPIO_ACTIVE_LOW>; - hci_spi: spbtle-rf@0 { + spbtle-rf@0 { compatible = "st,hci-spi-v1"; reg = <0>; reset-gpios = <&gpioa 8 GPIO_ACTIVE_LOW>; diff --git a/boards/st/disco_l475_iot1/disco_l475_iot1.dts b/boards/st/disco_l475_iot1/disco_l475_iot1.dts index 9b044533925..572e8768c9e 100644 --- a/boards/st/disco_l475_iot1/disco_l475_iot1.dts +++ b/boards/st/disco_l475_iot1/disco_l475_iot1.dts @@ -22,7 +22,6 @@ zephyr,code-partition = &slot0_partition; zephyr,flash-controller = &mx25r6435f; zephyr,bt-c2h-uart = &usart1; - zephyr,bt-hci = &hci_spi; }; leds { @@ -192,7 +191,7 @@ cs-gpios = <&gpiod 13 GPIO_ACTIVE_LOW>, <&gpioe 0 GPIO_ACTIVE_LOW>; - hci_spi: spbtle-rf@0 { + spbtle-rf@0 { compatible = "st,hci-spi-v1"; reg = <0>; reset-gpios = <&gpioa 8 GPIO_ACTIVE_LOW>; diff --git a/boards/st/sensortile_box/sensortile_box.dts b/boards/st/sensortile_box/sensortile_box.dts index 70a0b4f9007..102dbb6a73a 100644 --- a/boards/st/sensortile_box/sensortile_box.dts +++ b/boards/st/sensortile_box/sensortile_box.dts @@ -19,7 +19,6 @@ zephyr,sram = &sram0; zephyr,flash = &flash0; zephyr,bt-c2h-uart = &usart1; - zephyr,bt-hci = &spbtle_1s_sensortile_box; }; leds { diff --git a/boards/st/sensortile_box_pro/sensortile_box_pro.dts b/boards/st/sensortile_box_pro/sensortile_box_pro.dts index 06185c32d40..8bd870151a5 100644 --- a/boards/st/sensortile_box_pro/sensortile_box_pro.dts +++ b/boards/st/sensortile_box_pro/sensortile_box_pro.dts @@ -29,7 +29,6 @@ zephyr,sram = &sram0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &hci_spi; }; leds { @@ -164,7 +163,7 @@ stm32_lp_tick_source: &lptim1 { cs-gpios = <&gpioa 2 GPIO_ACTIVE_LOW>; status = "okay"; - hci_spi: bluenrg-lp@0 { + bluenrg-lp@0 { compatible = "st,hci-spi-v2"; reg = <0>; irq-gpios = <&gpiod 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; diff --git a/boards/st/steval_stwinbx1/steval_stwinbx1.dts b/boards/st/steval_stwinbx1/steval_stwinbx1.dts index 4debd8cc5c1..23eda67338a 100644 --- a/boards/st/steval_stwinbx1/steval_stwinbx1.dts +++ b/boards/st/steval_stwinbx1/steval_stwinbx1.dts @@ -32,8 +32,6 @@ zephyr,sram = &sram0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - - zephyr,bt-hci = &hci_spi; }; leds { @@ -166,7 +164,7 @@ stm32_lp_tick_source: &lptim1 { pinctrl-names = "default"; status = "okay"; cs-gpios = <&gpioe 1 GPIO_ACTIVE_LOW>; - hci_spi: bluenrg-2@0 { + bluenrg-2@0 { compatible = "st,hci-spi-v2"; reg = <0>; reset-gpios = <&gpiod 13 GPIO_ACTIVE_LOW>; diff --git a/boards/st/stm32l562e_dk/stm32l562e_dk_common.dtsi b/boards/st/stm32l562e_dk/stm32l562e_dk_common.dtsi index 2dd00d4ee21..ccd74b46ece 100644 --- a/boards/st/stm32l562e_dk/stm32l562e_dk_common.dtsi +++ b/boards/st/stm32l562e_dk/stm32l562e_dk_common.dtsi @@ -37,10 +37,6 @@ volt-sensor0 = &vref; volt-sensor1 = &vbat; }; - - chosen { - zephyr,bt-hci = &hci_spi; - }; }; &clk_hsi48 { @@ -118,7 +114,7 @@ stm32_lp_tick_source: &lptim1 { cs-gpios = <&gpiog 5 GPIO_ACTIVE_LOW>; status = "okay"; - hci_spi: spbtle-rf@0 { + spbtle-rf@0 { compatible = "st,hci-spi-v1"; reg = <0>; irq-gpios = <&gpiog 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; diff --git a/drivers/bluetooth/hci/hci_spi_st.c b/drivers/bluetooth/hci/hci_spi_st.c index fcfe2f4b750..d4b964ba21c 100644 --- a/drivers/bluetooth/hci/hci_spi_st.c +++ b/drivers/bluetooth/hci/hci_spi_st.c @@ -22,7 +22,7 @@ #include #include -#include +#include #include #define LOG_LEVEL CONFIG_BT_HCI_DRIVER_LOG_LEVEL @@ -90,10 +90,6 @@ static struct k_thread spi_rx_thread_data; #define BLUENRG_CONFIG_LL_ONLY_OFFSET 0x2C #define BLUENRG_CONFIG_LL_ONLY_LEN 0x01 -struct bt_spi_data { - bt_hci_recv_t recv; -}; - static const struct spi_dt_spec bus = SPI_DT_SPEC_INST_GET( 0, SPI_OP_MODE_MASTER | SPI_TRANSFER_MSB | SPI_WORD_SET(8) | SPI_LOCK_ON, 0); @@ -355,8 +351,7 @@ static int bt_spi_send_aci_config(uint8_t offset, const uint8_t *value, size_t v } #if !defined(CONFIG_BT_HCI_RAW) -static int bt_spi_bluenrg_setup(const struct device *dev, - const struct bt_hci_setup_params *params) +static int bt_spi_bluenrg_setup(const struct bt_hci_setup_params *params) { int ret; const bt_addr_t *addr = ¶ms->public_addr; @@ -501,9 +496,7 @@ static int bt_spi_rx_buf_construct(uint8_t *msg, struct net_buf **bufp, uint16_t static void bt_spi_rx_thread(void *p1, void *p2, void *p3) { - const struct device *dev = p1; - struct bt_spi_data *hci = dev->data; - + ARG_UNUSED(p1); ARG_UNUSED(p2); ARG_UNUSED(p3); @@ -546,14 +539,14 @@ static void bt_spi_rx_thread(void *p1, void *p2, void *p3) ret = bt_spi_rx_buf_construct(rxmsg, &buf, size); if (!ret) { /* Handle the received HCI data */ - hci->recv(dev, buf); + bt_recv(buf); buf = NULL; } } while (READ_CONDITION); } } -static int bt_spi_send(const struct device *dev, struct net_buf *buf) +static int bt_spi_send(struct net_buf *buf) { uint16_t size; uint8_t rx_first[1]; @@ -639,9 +632,8 @@ static int bt_spi_send(const struct device *dev, struct net_buf *buf) return ret; } -static int bt_spi_open(const struct device *dev, bt_hci_recv_t recv) +static int bt_spi_open(void) { - struct bt_spi_data *hci = dev->data; int err; /* Configure RST pin and hold BLE in Reset */ @@ -668,8 +660,6 @@ static int bt_spi_open(const struct device *dev, bt_hci_recv_t recv) return err; } - hci->recv = recv; - /* Take BLE out of reset */ k_sleep(K_MSEC(DT_INST_PROP_OR(0, reset_assert_duration_ms, 0))); gpio_pin_set_dt(&rst_gpio, 0); @@ -677,7 +667,7 @@ static int bt_spi_open(const struct device *dev, bt_hci_recv_t recv) /* Start RX thread */ k_thread_create(&spi_rx_thread_data, spi_rx_stack, K_KERNEL_STACK_SIZEOF(spi_rx_stack), - bt_spi_rx_thread, (void *)dev, NULL, NULL, + bt_spi_rx_thread, NULL, NULL, NULL, K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO), 0, K_NO_WAIT); @@ -693,7 +683,10 @@ static int bt_spi_open(const struct device *dev, bt_hci_recv_t recv) return 0; } -static const struct bt_hci_driver_api drv = { +static const struct bt_hci_driver drv = { + .name = DEVICE_DT_NAME(DT_DRV_INST(0)), + .bus = BT_HCI_DRIVER_BUS_SPI, + .quirks = BT_QUIRK_NO_RESET, #if defined(CONFIG_BT_BLUENRG_ACI) && !defined(CONFIG_BT_HCI_RAW) .setup = bt_spi_bluenrg_setup, #endif /* CONFIG_BT_BLUENRG_ACI && !CONFIG_BT_HCI_RAW */ @@ -701,7 +694,7 @@ static const struct bt_hci_driver_api drv = { .send = bt_spi_send, }; -static int bt_spi_init(const struct device *dev) +static int bt_spi_init(void) { if (!spi_is_ready_dt(&bus)) { @@ -719,16 +712,12 @@ static int bt_spi_init(const struct device *dev) return -ENODEV; } + bt_hci_driver_register(&drv); + + LOG_DBG("BT SPI initialized"); return 0; } -#define HCI_DEVICE_INIT(inst) \ - static struct bt_spi_data hci_data_##inst = { \ - }; \ - DEVICE_DT_INST_DEFINE(inst, bt_spi_init, NULL, &hci_data_##inst, NULL, \ - POST_KERNEL, CONFIG_BT_SPI_INIT_PRIORITY, &drv) - -/* Only one instance supported right now */ -HCI_DEVICE_INIT(0) +SYS_INIT(bt_spi_init, POST_KERNEL, CONFIG_BT_SPI_INIT_PRIORITY); diff --git a/drivers/bluetooth/hci/spi.c b/drivers/bluetooth/hci/spi.c index 05e46a1d182..26d8f32afd0 100644 --- a/drivers/bluetooth/hci/spi.c +++ b/drivers/bluetooth/hci/spi.c @@ -15,7 +15,7 @@ #include #include -#include +#include #define LOG_LEVEL CONFIG_BT_HCI_DRIVER_LOG_LEVEL #include @@ -66,10 +66,6 @@ LOG_MODULE_REGISTER(bt_driver); be transmitted across this HCI link #endif /* CONFIG_BT_L2CAP_TX_MTU > MAX_MTU */ -struct bt_spi_data { - bt_hci_recv_t recv; -}; - static uint8_t __noinit rxmsg[SPI_MAX_MSG_LEN]; static uint8_t __noinit txmsg[SPI_MAX_MSG_LEN]; @@ -240,9 +236,7 @@ static struct net_buf *bt_spi_rx_buf_construct(uint8_t *msg) static void bt_spi_rx_thread(void *p1, void *p2, void *p3) { - const struct device *dev = p1; - struct bt_spi_data *hci = dev->data; - + ARG_UNUSED(p1); ARG_UNUSED(p2); ARG_UNUSED(p3); @@ -294,19 +288,17 @@ static void bt_spi_rx_thread(void *p1, void *p2, void *p3) buf = bt_spi_rx_buf_construct(rxmsg); if (buf) { /* Handle the received HCI data */ - hci->recv(dev, buf); + bt_recv(buf); } } } -static int bt_spi_send(const struct device *dev, struct net_buf *buf) +static int bt_spi_send(struct net_buf *buf) { uint16_t size; uint8_t rx_first[1]; int ret; - ARG_UNUSED(dev); - LOG_DBG(""); /* Buffer needs an additional byte for type */ @@ -372,9 +364,8 @@ static int bt_spi_send(const struct device *dev, struct net_buf *buf) return ret; } -static int bt_spi_open(const struct device *dev, bt_hci_recv_t recv) +static int bt_spi_open(void) { - struct bt_spi_data *hci = dev->data; int err; /* Configure RST pin and hold BLE in Reset */ @@ -401,8 +392,6 @@ static int bt_spi_open(const struct device *dev, bt_hci_recv_t recv) return err; } - hci->recv = recv; - /* Take BLE out of reset */ k_sleep(K_MSEC(DT_INST_PROP_OR(0, reset_assert_duration_ms, 0))); gpio_pin_set_dt(&rst_gpio, 0); @@ -410,7 +399,7 @@ static int bt_spi_open(const struct device *dev, bt_hci_recv_t recv) /* Start RX thread */ k_thread_create(&spi_rx_thread_data, spi_rx_stack, K_KERNEL_STACK_SIZEOF(spi_rx_stack), - bt_spi_rx_thread, (void *)dev, NULL, NULL, + bt_spi_rx_thread, NULL, NULL, NULL, K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO), 0, K_NO_WAIT); @@ -420,14 +409,15 @@ static int bt_spi_open(const struct device *dev, bt_hci_recv_t recv) return 0; } -static const struct bt_hci_driver_api drv = { +static const struct bt_hci_driver drv = { + .name = DEVICE_DT_NAME(DT_DRV_INST(0)), + .bus = BT_HCI_DRIVER_BUS_SPI, .open = bt_spi_open, .send = bt_spi_send, }; -static int bt_spi_init(const struct device *dev) +static int bt_spi_init(void) { - ARG_UNUSED(dev); if (!spi_is_ready_dt(&bus)) { LOG_ERR("SPI device not ready"); @@ -444,16 +434,12 @@ static int bt_spi_init(const struct device *dev) return -ENODEV; } + bt_hci_driver_register(&drv); + + LOG_DBG("BT SPI initialized"); return 0; } -#define HCI_DEVICE_INIT(inst) \ - static struct bt_spi_data hci_data_##inst = { \ - }; \ - DEVICE_DT_INST_DEFINE(inst, bt_spi_init, NULL, &hci_data_##inst, NULL, \ - POST_KERNEL, CONFIG_BT_SPI_INIT_PRIORITY, &drv) - -/* Only one instance supported right now */ -HCI_DEVICE_INIT(0) +SYS_INIT(bt_spi_init, POST_KERNEL, CONFIG_BT_SPI_INIT_PRIORITY); diff --git a/dts/bindings/bluetooth/st,hci-spi-v1.yaml b/dts/bindings/bluetooth/st,hci-spi-v1.yaml index 020a796af85..3784c88ded0 100644 --- a/dts/bindings/bluetooth/st,hci-spi-v1.yaml +++ b/dts/bindings/bluetooth/st,hci-spi-v1.yaml @@ -6,7 +6,3 @@ description: STMicroelectronics SPI protocol V1 compatible with BlueNRG-MS devic compatible: "st,hci-spi-v1" include: zephyr,bt-hci-spi.yaml - -properties: - bt-hci-quirks: - default: ["BT_HCI_QUIRK_NO_RESET"] diff --git a/dts/bindings/bluetooth/st,hci-spi-v2.yaml b/dts/bindings/bluetooth/st,hci-spi-v2.yaml index 97b62dc90bd..36b25eae768 100644 --- a/dts/bindings/bluetooth/st,hci-spi-v2.yaml +++ b/dts/bindings/bluetooth/st,hci-spi-v2.yaml @@ -6,7 +6,3 @@ description: STMicroelectronics SPI protocol V2 compatible with BlueNRG-1 and su compatible: "st,hci-spi-v2" include: zephyr,bt-hci-spi.yaml - -properties: - bt-hci-quirks: - default: ["BT_HCI_QUIRK_NO_RESET"] diff --git a/dts/bindings/bluetooth/zephyr,bt-hci-spi.yaml b/dts/bindings/bluetooth/zephyr,bt-hci-spi.yaml index 0447e69d5f1..50d0e311461 100644 --- a/dts/bindings/bluetooth/zephyr,bt-hci-spi.yaml +++ b/dts/bindings/bluetooth/zephyr,bt-hci-spi.yaml @@ -7,7 +7,7 @@ description: | compatible: "zephyr,bt-hci-spi" -include: [spi-device.yaml, bt-hci.yaml] +include: spi-device.yaml properties: irq-gpios: @@ -35,9 +35,3 @@ properties: resulting in an ignored transaction that then needs to be performed a second time. The default of 20uS was chosen as the lowest delay that reliably eliminated double transactions between a nRF9160 host and a nRF52832 controller. - - bt-hci-name: - default: "SPI" - - bt-hci-bus: - default: "BT_HCI_BUS_SPI" From 7c827b4919739cedb082acc75cb7b07df03d6b86 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 235/825] Revert "[nrf fromtree] drivers: bluetooth: hci: Add BlueNRG reset API to ST HCI SPI BT driver" This reverts commit 098ee1dff209a2e74427600ccf43fc72bbee3062. --- drivers/bluetooth/hci/hci_spi_st.c | 50 +++--------------------------- 1 file changed, 5 insertions(+), 45 deletions(-) diff --git a/drivers/bluetooth/hci/hci_spi_st.c b/drivers/bluetooth/hci/hci_spi_st.c index d4b964ba21c..d45dbb592a1 100644 --- a/drivers/bluetooth/hci/hci_spi_st.c +++ b/drivers/bluetooth/hci/hci_spi_st.c @@ -38,7 +38,7 @@ LOG_MODULE_REGISTER(bt_driver); #define READY_NOW 0x02 #define EVT_BLUE_INITIALIZED 0x01 -#define FW_STARTED_PROPERLY 0X01 + /* Offsets */ #define STATUS_HEADER_READY 0 #define STATUS_HEADER_TOREAD 3 @@ -51,7 +51,6 @@ LOG_MODULE_REGISTER(bt_driver); #define EVT_LE_META_SUBEVENT 3 #define EVT_VENDOR_CODE_LSB 3 #define EVT_VENDOR_CODE_MSB 4 -#define REASON_CODE 5 #define CMD_OGF 1 #define CMD_OCF 2 @@ -90,6 +89,8 @@ static struct k_thread spi_rx_thread_data; #define BLUENRG_CONFIG_LL_ONLY_OFFSET 0x2C #define BLUENRG_CONFIG_LL_ONLY_LEN 0x01 +static int bt_spi_send_aci_config(uint8_t offset, const uint8_t *value, size_t value_len); + static const struct spi_dt_spec bus = SPI_DT_SPEC_INST_GET( 0, SPI_OP_MODE_MASTER | SPI_TRANSFER_MSB | SPI_WORD_SET(8) | SPI_LOCK_ON, 0); @@ -109,43 +110,6 @@ struct bt_hci_ext_evt_hdr { uint16_t len; } __packed; -int bluenrg_bt_reset(bool updater_mode) -{ - int err = 0; - /* Assert reset */ - if (!updater_mode) { - gpio_pin_set_dt(&rst_gpio, 1); - k_sleep(K_MSEC(DT_INST_PROP_OR(0, reset_assert_duration_ms, 0))); - gpio_pin_set_dt(&rst_gpio, 0); - } else { -#if DT_HAS_COMPAT_STATUS_OKAY(st_hci_spi_v2) - return -ENOTSUP; -#else /* DT_HAS_COMPAT_STATUS_OKAY(st_hci_spi_v1) */ - gpio_pin_set_dt(&rst_gpio, 1); - gpio_pin_interrupt_configure_dt(&irq_gpio, GPIO_INT_DISABLE); - /* Configure IRQ pin as output and force it high */ - err = gpio_pin_configure_dt(&irq_gpio, GPIO_OUTPUT_ACTIVE); - if (err) { - return err; - } - /* Add reset delay and release reset */ - k_sleep(K_MSEC(DT_INST_PROP_OR(0, reset_assert_duration_ms, 0))); - gpio_pin_set_dt(&rst_gpio, 0); - /* Give firmware some time to read the IRQ high */ - k_sleep(K_MSEC(5)); - gpio_pin_interrupt_configure_dt(&irq_gpio, GPIO_INT_EDGE_TO_ACTIVE); - /* Reconfigure IRQ pin as input */ - err = gpio_pin_configure_dt(&irq_gpio, GPIO_INPUT); - if (err) { - return err; - } - /* Emulate possibly missed rising edge IRQ by signaling the IRQ semaphore */ - k_sem_give(&sem_request); -#endif /* DT_HAS_COMPAT_STATUS_OKAY(st_hci_spi_v2) */ - } - return err; -} - static inline int bt_spi_transceive(void *tx, uint32_t tx_len, void *rx, uint32_t rx_len) { @@ -178,17 +142,13 @@ static void bt_spi_isr(const struct device *unused1, static bool bt_spi_handle_vendor_evt(uint8_t *msg) { bool handled = false; - uint8_t reset_reason; switch (bt_spi_get_evt(msg)) { case EVT_BLUE_INITIALIZED: { - reset_reason = msg[REASON_CODE]; - if (reset_reason == FW_STARTED_PROPERLY) { - k_sem_give(&sem_initialised); + k_sem_give(&sem_initialised); #if defined(CONFIG_BT_BLUENRG_ACI) - handled = true; + handled = true; #endif - } } default: break; From f8e420adc346f9cb97894e76fe104c1c906cc03e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 236/825] Revert "[nrf fromtree] Bluetooth: drivers: Convert ESP32 HCI driver to new API" This reverts commit 5a43b0e92b2e6b7428c0aaf7da8b3e589aaec8f9. --- .../esp32_devkitc_wroom/Kconfig.defconfig | 3 ++ .../esp32_devkitc_wroom_procpu.dts | 5 --- .../esp32_devkitc_wrover/Kconfig.defconfig | 3 ++ .../esp32_devkitc_wrover_procpu.dts | 5 --- .../esp32_ethernet_kit/Kconfig.defconfig | 3 ++ .../esp32_ethernet_kit_procpu.dts | 5 --- .../esp32c3_devkitm/Kconfig.defconfig | 3 ++ .../esp32c3_devkitm/esp32c3_devkitm.dts | 5 --- .../esp32s3_devkitc/Kconfig.defconfig | 3 ++ .../esp32s3_devkitc_procpu.dts | 5 --- .../esp32s3_devkitm/Kconfig.defconfig | 3 ++ .../esp32s3_devkitm_procpu.dts | 5 --- .../esp_wrover_kit/Kconfig.defconfig | 3 ++ .../esp_wrover_kit/esp_wrover_kit_procpu.dts | 5 --- boards/hardkernel/odroid_go/Kconfig.defconfig | 3 ++ .../hardkernel/odroid_go/odroid_go_procpu.dts | 5 --- .../heltec_wifi_lora32_v2/Kconfig.defconfig | 3 ++ .../heltec_wifi_lora32_v2_procpu.dts | 5 --- .../Kconfig.defconfig | 3 ++ .../heltec_wireless_stick_lite_v3_procpu.dts | 5 --- .../kincony_kc868_a32/Kconfig.defconfig | 3 ++ .../kincony_kc868_a32_procpu.dts | 5 --- .../esp32c3_luatos_core/Kconfig.defconfig | 3 ++ .../esp32c3_luatos_core.dts | 1 - .../esp32c3_luatos_core.dtsi | 4 -- .../esp32s3_luatos_core/Kconfig.defconfig | 3 ++ .../esp32s3_luatos_core.dtsi | 4 -- .../esp32s3_luatos_core_procpu.dts | 1 - .../esp32s3_luatos_core_procpu_usb.dts | 1 - .../m5stack_atom_lite/Kconfig.defconfig | 3 ++ .../m5stack_atom_lite_procpu.dts | 5 --- .../m5stack/m5stack_atoms3/Kconfig.defconfig | 3 ++ .../m5stack_atoms3/m5stack_atoms3_procpu.dts | 5 --- .../m5stack_atoms3_lite/Kconfig.defconfig | 3 ++ .../m5stack_atoms3_lite_procpu.dts | 5 --- .../m5stack/m5stack_core2/Kconfig.defconfig | 3 ++ .../m5stack_core2/m5stack_core2_procpu.dts | 5 --- .../m5stack/m5stack_stamps3/Kconfig.defconfig | 3 ++ .../m5stack_stamps3_procpu.dts | 5 --- .../m5stack/m5stickc_plus/Kconfig.defconfig | 3 ++ .../m5stickc_plus/m5stickc_plus_procpu.dts | 5 --- boards/m5stack/stamp_c3/Kconfig.defconfig | 7 +++ boards/m5stack/stamp_c3/stamp_c3.dts | 5 --- .../olimex/olimex_esp32_evb/Kconfig.defconfig | 3 ++ .../olimex_esp32_evb_procpu.dts | 5 --- boards/others/icev_wireless/Kconfig.defconfig | 3 ++ boards/others/icev_wireless/icev_wireless.dts | 5 --- boards/seeed/xiao_esp32c3/Kconfig.defconfig | 3 ++ boards/seeed/xiao_esp32c3/xiao_esp32c3.dts | 5 --- boards/seeed/xiao_esp32s3/Kconfig.defconfig | 3 ++ .../xiao_esp32s3/xiao_esp32s3_procpu.dts | 5 --- boards/vcc-gnd/yd_esp32/Kconfig.defconfig | 3 ++ boards/vcc-gnd/yd_esp32/yd_esp32_procpu.dts | 5 --- .../esp32s3_touch_lcd_1_28/Kconfig.defconfig | 3 ++ .../esp32s3_touch_lcd_1_28_esp32s3_procpu.dts | 5 --- drivers/bluetooth/hci/Kconfig | 2 - drivers/bluetooth/hci/hci_esp32.c | 45 ++++++++----------- .../bluetooth/espressif,esp32-bt-hci.yaml | 13 ------ .../espressif/esp32c3/esp32c3_common.dtsi | 6 --- dts/xtensa/espressif/esp32/esp32_common.dtsi | 6 --- .../espressif/esp32s2/esp32s2_common.dtsi | 5 --- .../espressif/esp32s3/esp32s3_common.dtsi | 5 --- 62 files changed, 100 insertions(+), 195 deletions(-) delete mode 100644 dts/bindings/bluetooth/espressif,esp32-bt-hci.yaml diff --git a/boards/espressif/esp32_devkitc_wroom/Kconfig.defconfig b/boards/espressif/esp32_devkitc_wroom/Kconfig.defconfig index 374b423b548..3cafb138007 100644 --- a/boards/espressif/esp32_devkitc_wroom/Kconfig.defconfig +++ b/boards/espressif/esp32_devkitc_wroom/Kconfig.defconfig @@ -12,6 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_ESP32_DEVKITC_WROOM_ESP32_PROCPU if BOARD_ESP32_DEVKITC_WROOM_ESP32_APPCPU diff --git a/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom_procpu.dts b/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom_procpu.dts index 1daad17069f..1708a7badf9 100644 --- a/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom_procpu.dts +++ b/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom_procpu.dts @@ -36,7 +36,6 @@ zephyr,shell-uart = &uart0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; }; @@ -175,7 +174,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/espressif/esp32_devkitc_wrover/Kconfig.defconfig b/boards/espressif/esp32_devkitc_wrover/Kconfig.defconfig index c56c404a40e..e2c3cf70383 100644 --- a/boards/espressif/esp32_devkitc_wrover/Kconfig.defconfig +++ b/boards/espressif/esp32_devkitc_wrover/Kconfig.defconfig @@ -10,6 +10,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_ESP32_DEVKITC_WROVER_ESP32_PROCPU if BOARD_ESP32_DEVKITC_WROVER_ESP32_APPCPU diff --git a/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_procpu.dts b/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_procpu.dts index bbdd91e6c87..60a063bc875 100644 --- a/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_procpu.dts +++ b/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_procpu.dts @@ -36,7 +36,6 @@ zephyr,shell-uart = &uart0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; }; @@ -170,7 +169,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/espressif/esp32_ethernet_kit/Kconfig.defconfig b/boards/espressif/esp32_ethernet_kit/Kconfig.defconfig index 57924049022..8222793d52a 100644 --- a/boards/espressif/esp32_ethernet_kit/Kconfig.defconfig +++ b/boards/espressif/esp32_ethernet_kit/Kconfig.defconfig @@ -19,6 +19,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_ESP32_ETHERNET_KIT_ESP32_PROCPU if BOARD_ESP32_ETHERNET_KIT_ESP32_APPCPU diff --git a/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu.dts b/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu.dts index 61f9b1d2634..7e8310c9605 100644 --- a/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu.dts +++ b/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu.dts @@ -23,7 +23,6 @@ zephyr,shell-uart = &uart0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; }; @@ -131,7 +130,3 @@ ð { phy-handle = <&phy>; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/espressif/esp32c3_devkitm/Kconfig.defconfig b/boards/espressif/esp32c3_devkitm/Kconfig.defconfig index cf5aeac8382..9cd90fc1caf 100644 --- a/boards/espressif/esp32c3_devkitm/Kconfig.defconfig +++ b/boards/espressif/esp32c3_devkitm/Kconfig.defconfig @@ -9,3 +9,6 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 51200 if WIFI default 40960 if BT default 4096 + +config BT_ESP32 + default y if BT diff --git a/boards/espressif/esp32c3_devkitm/esp32c3_devkitm.dts b/boards/espressif/esp32c3_devkitm/esp32c3_devkitm.dts index 945f8e8a598..f1d9481a8b7 100644 --- a/boards/espressif/esp32c3_devkitm/esp32c3_devkitm.dts +++ b/boards/espressif/esp32c3_devkitm/esp32c3_devkitm.dts @@ -20,7 +20,6 @@ zephyr,shell-uart = &uart0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; aliases { @@ -135,7 +134,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/espressif/esp32s3_devkitc/Kconfig.defconfig b/boards/espressif/esp32s3_devkitc/Kconfig.defconfig index d539cd66523..a85e047ceae 100644 --- a/boards/espressif/esp32s3_devkitc/Kconfig.defconfig +++ b/boards/espressif/esp32s3_devkitc/Kconfig.defconfig @@ -12,6 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_ESP32S3_DEVKITC_ESP32S3_PROCPU if BOARD_ESP32S3_DEVKITC_ESP32S3_APPCPU diff --git a/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu.dts b/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu.dts index e446d357294..4538c41fa5f 100644 --- a/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu.dts +++ b/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu.dts @@ -25,7 +25,6 @@ zephyr,shell-uart = &uart0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; aliases { @@ -177,7 +176,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/espressif/esp32s3_devkitm/Kconfig.defconfig b/boards/espressif/esp32s3_devkitm/Kconfig.defconfig index 26339590ee3..e24f82b64a6 100644 --- a/boards/espressif/esp32s3_devkitm/Kconfig.defconfig +++ b/boards/espressif/esp32s3_devkitm/Kconfig.defconfig @@ -12,6 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_ESP32S3_DEVKITM_ESP32S3_PROCPU if BOARD_ESP32S3_DEVKITM_ESP32S3_APPCPU diff --git a/boards/espressif/esp32s3_devkitm/esp32s3_devkitm_procpu.dts b/boards/espressif/esp32s3_devkitm/esp32s3_devkitm_procpu.dts index 6a8e841b95b..0cb8b962829 100644 --- a/boards/espressif/esp32s3_devkitm/esp32s3_devkitm_procpu.dts +++ b/boards/espressif/esp32s3_devkitm/esp32s3_devkitm_procpu.dts @@ -25,7 +25,6 @@ zephyr,shell-uart = &uart0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; aliases { @@ -181,7 +180,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/espressif/esp_wrover_kit/Kconfig.defconfig b/boards/espressif/esp_wrover_kit/Kconfig.defconfig index adf8cd7e398..8fd73caab2c 100644 --- a/boards/espressif/esp_wrover_kit/Kconfig.defconfig +++ b/boards/espressif/esp_wrover_kit/Kconfig.defconfig @@ -12,6 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + config DISK_DRIVER_SDMMC default y diff --git a/boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu.dts b/boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu.dts index df387a293bf..ac0bacd604c 100644 --- a/boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu.dts +++ b/boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu.dts @@ -36,7 +36,6 @@ zephyr,code-partition = &slot0_partition; zephyr,display = &ili9341; zephyr,sdhc = &sdhc1; - zephyr,bt-hci = &esp32_bt_hci; }; leds { @@ -252,7 +251,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/hardkernel/odroid_go/Kconfig.defconfig b/boards/hardkernel/odroid_go/Kconfig.defconfig index 2f38123c8db..c78115d8985 100644 --- a/boards/hardkernel/odroid_go/Kconfig.defconfig +++ b/boards/hardkernel/odroid_go/Kconfig.defconfig @@ -25,6 +25,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_ODROID_GO_ESP32_PROCPU if BOARD_ODROID_GO_ESP32_APPCPU diff --git a/boards/hardkernel/odroid_go/odroid_go_procpu.dts b/boards/hardkernel/odroid_go/odroid_go_procpu.dts index 4349e6aafe9..c17c25823e2 100644 --- a/boards/hardkernel/odroid_go/odroid_go_procpu.dts +++ b/boards/hardkernel/odroid_go/odroid_go_procpu.dts @@ -20,7 +20,6 @@ zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; zephyr,display = &ili9341; - zephyr,bt-hci = &esp32_bt_hci; }; leds { @@ -215,7 +214,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/heltec/heltec_wifi_lora32_v2/Kconfig.defconfig b/boards/heltec/heltec_wifi_lora32_v2/Kconfig.defconfig index a2979499b65..eafe4773552 100644 --- a/boards/heltec/heltec_wifi_lora32_v2/Kconfig.defconfig +++ b/boards/heltec/heltec_wifi_lora32_v2/Kconfig.defconfig @@ -12,6 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_HELTEC_WIFI_LORA32_V2_ESP32_PROCPU if BOARD_HELTEC_WIFI_LORA32_V2_ESP32_APPCPU diff --git a/boards/heltec/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_procpu.dts b/boards/heltec/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_procpu.dts index 946c4da81af..5e1c8c6c6ff 100644 --- a/boards/heltec/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_procpu.dts +++ b/boards/heltec/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_procpu.dts @@ -55,7 +55,6 @@ zephyr,shell-uart = &uart0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; }; @@ -158,9 +157,5 @@ }; }; -&esp32_bt_hci { - status = "okay"; -}; - /* Required by the ssd1306_128x64 shield which enables the OLED display */ arduino_i2c: &i2c0 {}; diff --git a/boards/heltec/heltec_wireless_stick_lite_v3/Kconfig.defconfig b/boards/heltec/heltec_wireless_stick_lite_v3/Kconfig.defconfig index c1aa6f030c7..d92fca42fa3 100644 --- a/boards/heltec/heltec_wireless_stick_lite_v3/Kconfig.defconfig +++ b/boards/heltec/heltec_wireless_stick_lite_v3/Kconfig.defconfig @@ -13,6 +13,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_HELTEC_WIRELESS_STICK_LITE_V3_ESP32S3_PROCPU if BOARD_HELTEC_WIRELESS_STICK_LITE_V3_ESP32S3_APPCPU diff --git a/boards/heltec/heltec_wireless_stick_lite_v3/heltec_wireless_stick_lite_v3_procpu.dts b/boards/heltec/heltec_wireless_stick_lite_v3/heltec_wireless_stick_lite_v3_procpu.dts index ef895dfc693..255fc34c051 100644 --- a/boards/heltec/heltec_wireless_stick_lite_v3/heltec_wireless_stick_lite_v3_procpu.dts +++ b/boards/heltec/heltec_wireless_stick_lite_v3/heltec_wireless_stick_lite_v3_procpu.dts @@ -72,7 +72,6 @@ zephyr,shell-uart = &uart0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; }; @@ -214,7 +213,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/kincony/kincony_kc868_a32/Kconfig.defconfig b/boards/kincony/kincony_kc868_a32/Kconfig.defconfig index 4d4613b36ad..43a91bfec28 100644 --- a/boards/kincony/kincony_kc868_a32/Kconfig.defconfig +++ b/boards/kincony/kincony_kc868_a32/Kconfig.defconfig @@ -10,6 +10,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_KINCONY_KC868_A32_ESP32_PROCPU if BOARD_KINCONY_KC868_A32_ESP32_APPCPU diff --git a/boards/kincony/kincony_kc868_a32/kincony_kc868_a32_procpu.dts b/boards/kincony/kincony_kc868_a32/kincony_kc868_a32_procpu.dts index 4bbe6815278..0f459d7f7c5 100644 --- a/boards/kincony/kincony_kc868_a32/kincony_kc868_a32_procpu.dts +++ b/boards/kincony/kincony_kc868_a32/kincony_kc868_a32_procpu.dts @@ -23,7 +23,6 @@ zephyr,shell-uart = &uart0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; }; @@ -213,7 +212,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/luatos/esp32c3_luatos_core/Kconfig.defconfig b/boards/luatos/esp32c3_luatos_core/Kconfig.defconfig index f6ad1adaa1c..6454816e243 100644 --- a/boards/luatos/esp32c3_luatos_core/Kconfig.defconfig +++ b/boards/luatos/esp32c3_luatos_core/Kconfig.defconfig @@ -9,3 +9,6 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 51200 if WIFI default 40960 if BT default 4096 + +config BT_ESP32 + default y if BT diff --git a/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core.dts b/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core.dts index cfdfd771d13..00a69833557 100644 --- a/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core.dts +++ b/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core.dts @@ -15,6 +15,5 @@ zephyr,shell-uart = &uart0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; }; diff --git a/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core.dtsi b/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core.dtsi index f4c4f553a9a..bf83c33898c 100644 --- a/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core.dtsi +++ b/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core.dtsi @@ -134,7 +134,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/luatos/esp32s3_luatos_core/Kconfig.defconfig b/boards/luatos/esp32s3_luatos_core/Kconfig.defconfig index a14482e325d..f14d264fb08 100644 --- a/boards/luatos/esp32s3_luatos_core/Kconfig.defconfig +++ b/boards/luatos/esp32s3_luatos_core/Kconfig.defconfig @@ -12,6 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_ESP32S3_LUATOS_CORE_ESP32S3_PROCPU || BOARD_ESP32S3_LUATOS_CORE_ESP32S3_PROCPU_USB if BOARD_ESP32S3_LUATOS_CORE_ESP32S3_APPCPU || BOARD_ESP32S3_LUATOS_CORE_ESP32S3_APPCPU_USB diff --git a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core.dtsi b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core.dtsi index 4ca147222ac..849dd35bd67 100644 --- a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core.dtsi +++ b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core.dtsi @@ -149,7 +149,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu.dts b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu.dts index 2a04d568066..8c44d0cebd7 100644 --- a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu.dts +++ b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu.dts @@ -26,6 +26,5 @@ zephyr,shell-uart = &uart0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; }; diff --git a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu_usb.dts b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu_usb.dts index a4182a4ba80..0a707724f9f 100644 --- a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu_usb.dts +++ b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu_usb.dts @@ -25,7 +25,6 @@ zephyr,console = &usb_serial; zephyr,shell-uart = &usb_serial; zephyr,flash = &flash0; - zephyr,bt_hci = &esp32_bt_hci; }; }; diff --git a/boards/m5stack/m5stack_atom_lite/Kconfig.defconfig b/boards/m5stack/m5stack_atom_lite/Kconfig.defconfig index 2b223f5409b..56e38c448a4 100644 --- a/boards/m5stack/m5stack_atom_lite/Kconfig.defconfig +++ b/boards/m5stack/m5stack_atom_lite/Kconfig.defconfig @@ -12,6 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_M5STACK_ATOM_LITE_ESP32_PROCPU if BOARD_M5STACK_ATOM_LITE_ESP32_APPCPU diff --git a/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_procpu.dts b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_procpu.dts index 9d953801e1d..53f6175e4d1 100644 --- a/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_procpu.dts +++ b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_procpu.dts @@ -24,7 +24,6 @@ zephyr,shell-uart = &uart0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; aliases { @@ -189,7 +188,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/m5stack/m5stack_atoms3/Kconfig.defconfig b/boards/m5stack/m5stack_atoms3/Kconfig.defconfig index f3b59178417..96da63c4d67 100644 --- a/boards/m5stack/m5stack_atoms3/Kconfig.defconfig +++ b/boards/m5stack/m5stack_atoms3/Kconfig.defconfig @@ -14,6 +14,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_M5STACK_ATOMS3_ESP32S3_PROCPU if BOARD_M5STACK_ATOMS3_ESP32S3_APPCPU diff --git a/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts b/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts index 376056af071..1b5a5da32da 100644 --- a/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts +++ b/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts @@ -21,7 +21,6 @@ zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; zephyr,display = &st7789v; - zephyr,bt-hci = &esp32_bt_hci; }; aliases { @@ -186,7 +185,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/m5stack/m5stack_atoms3_lite/Kconfig.defconfig b/boards/m5stack/m5stack_atoms3_lite/Kconfig.defconfig index f0f262cd1f3..918a3ae2692 100644 --- a/boards/m5stack/m5stack_atoms3_lite/Kconfig.defconfig +++ b/boards/m5stack/m5stack_atoms3_lite/Kconfig.defconfig @@ -14,6 +14,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD config KERNEL_MEM_POOL default y +config BT_ESP32 + default y if BT + endif # BOARD_M5STACK_ATOMS3_LITE_ESP32S3_PROCPU if BOARD_M5STACK_ATOMS3_LITE_ESP32S3_APPCPU diff --git a/boards/m5stack/m5stack_atoms3_lite/m5stack_atoms3_lite_procpu.dts b/boards/m5stack/m5stack_atoms3_lite/m5stack_atoms3_lite_procpu.dts index 708fdb5a114..430de46a554 100644 --- a/boards/m5stack/m5stack_atoms3_lite/m5stack_atoms3_lite_procpu.dts +++ b/boards/m5stack/m5stack_atoms3_lite/m5stack_atoms3_lite_procpu.dts @@ -22,7 +22,6 @@ zephyr,shell-uart = &usb_serial; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; aliases { @@ -154,7 +153,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/m5stack/m5stack_core2/Kconfig.defconfig b/boards/m5stack/m5stack_core2/Kconfig.defconfig index fd9614d6cbb..e3aba605716 100644 --- a/boards/m5stack/m5stack_core2/Kconfig.defconfig +++ b/boards/m5stack/m5stack_core2/Kconfig.defconfig @@ -15,6 +15,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD config KERNEL_MEM_POOL default y +config BT_ESP32 + default y if BT + config GPIO_HOGS_INIT_PRIORITY default 70 diff --git a/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts b/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts index 0d9f38e7678..7cd5bc187c9 100644 --- a/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts +++ b/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts @@ -34,7 +34,6 @@ zephyr,display = &ili9342c; zephyr,code-partition = &slot0_partition; zephyr,rtc = &pfc8563_rtc; - zephyr,bt-hci = &esp32_bt_hci; }; leds { @@ -292,7 +291,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/m5stack/m5stack_stamps3/Kconfig.defconfig b/boards/m5stack/m5stack_stamps3/Kconfig.defconfig index 903059dffbc..f2254332b4b 100644 --- a/boards/m5stack/m5stack_stamps3/Kconfig.defconfig +++ b/boards/m5stack/m5stack_stamps3/Kconfig.defconfig @@ -14,6 +14,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD config KERNEL_MEM_POOL default y +config BT_ESP32 + default y if BT + endif # BOARD_M5STACK_STAMPS3_ESP32S3_PROCPU if BOARD_M5STACK_STAMPS3_ESP32S3_APPCPU diff --git a/boards/m5stack/m5stack_stamps3/m5stack_stamps3_procpu.dts b/boards/m5stack/m5stack_stamps3/m5stack_stamps3_procpu.dts index e1a92d331a8..f832f4618ba 100644 --- a/boards/m5stack/m5stack_stamps3/m5stack_stamps3_procpu.dts +++ b/boards/m5stack/m5stack_stamps3/m5stack_stamps3_procpu.dts @@ -23,7 +23,6 @@ zephyr,shell-uart = &usb_serial; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; aliases { @@ -194,7 +193,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/m5stack/m5stickc_plus/Kconfig.defconfig b/boards/m5stack/m5stickc_plus/Kconfig.defconfig index a6b957227be..f9490d98a57 100644 --- a/boards/m5stack/m5stickc_plus/Kconfig.defconfig +++ b/boards/m5stack/m5stickc_plus/Kconfig.defconfig @@ -12,6 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + config GPIO_HOGS_INIT_PRIORITY default 70 diff --git a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts index 651610a1fe5..c1418ed51c3 100644 --- a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts +++ b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts @@ -33,7 +33,6 @@ zephyr,code-partition = &slot0_partition; zephyr,rtc = &bm8563; zephyr,display = &st7789v; - zephyr,bt-hci = &esp32_bt_hci; }; leds { @@ -249,7 +248,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/m5stack/stamp_c3/Kconfig.defconfig b/boards/m5stack/stamp_c3/Kconfig.defconfig index dcc3a422548..949f876f7bc 100644 --- a/boards/m5stack/stamp_c3/Kconfig.defconfig +++ b/boards/m5stack/stamp_c3/Kconfig.defconfig @@ -9,3 +9,10 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 51200 if WIFI default 40960 if BT default 4096 + +if BT + +config BT_ESP32 + default y + +endif # BT diff --git a/boards/m5stack/stamp_c3/stamp_c3.dts b/boards/m5stack/stamp_c3/stamp_c3.dts index 09370c3d30a..812c2aeaa86 100644 --- a/boards/m5stack/stamp_c3/stamp_c3.dts +++ b/boards/m5stack/stamp_c3/stamp_c3.dts @@ -20,7 +20,6 @@ zephyr,shell-uart = &uart0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; aliases { @@ -134,7 +133,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/olimex/olimex_esp32_evb/Kconfig.defconfig b/boards/olimex/olimex_esp32_evb/Kconfig.defconfig index e3269639038..cc6993e52e6 100644 --- a/boards/olimex/olimex_esp32_evb/Kconfig.defconfig +++ b/boards/olimex/olimex_esp32_evb/Kconfig.defconfig @@ -12,6 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_OLIMEX_ESP32_EVB_ESP32_PROCPU if BOARD_OLIMEX_ESP32_EVB_ESP32_APPCPU diff --git a/boards/olimex/olimex_esp32_evb/olimex_esp32_evb_procpu.dts b/boards/olimex/olimex_esp32_evb/olimex_esp32_evb_procpu.dts index f731d277684..63070f08e1c 100644 --- a/boards/olimex/olimex_esp32_evb/olimex_esp32_evb_procpu.dts +++ b/boards/olimex/olimex_esp32_evb/olimex_esp32_evb_procpu.dts @@ -20,7 +20,6 @@ zephyr,sram = &sram0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; aliases { @@ -173,7 +172,3 @@ uext_spi: &spi2 {}; }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/others/icev_wireless/Kconfig.defconfig b/boards/others/icev_wireless/Kconfig.defconfig index b7c82093375..2aa7b0a4f48 100644 --- a/boards/others/icev_wireless/Kconfig.defconfig +++ b/boards/others/icev_wireless/Kconfig.defconfig @@ -7,3 +7,6 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 51200 if WIFI default 40960 if BT default 4096 + +config BT_ESP32 + default y if BT diff --git a/boards/others/icev_wireless/icev_wireless.dts b/boards/others/icev_wireless/icev_wireless.dts index 8bd52196603..8ed474200e0 100644 --- a/boards/others/icev_wireless/icev_wireless.dts +++ b/boards/others/icev_wireless/icev_wireless.dts @@ -20,7 +20,6 @@ zephyr,shell-uart = &usb_serial; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; aliases { @@ -131,7 +130,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/seeed/xiao_esp32c3/Kconfig.defconfig b/boards/seeed/xiao_esp32c3/Kconfig.defconfig index 4171bb04bc2..d641d8be3a9 100644 --- a/boards/seeed/xiao_esp32c3/Kconfig.defconfig +++ b/boards/seeed/xiao_esp32c3/Kconfig.defconfig @@ -7,3 +7,6 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 51200 if WIFI default 40960 if BT default 4096 + +config BT_ESP32 + default y if BT diff --git a/boards/seeed/xiao_esp32c3/xiao_esp32c3.dts b/boards/seeed/xiao_esp32c3/xiao_esp32c3.dts index 38a53f0ad9d..8475709095b 100644 --- a/boards/seeed/xiao_esp32c3/xiao_esp32c3.dts +++ b/boards/seeed/xiao_esp32c3/xiao_esp32c3.dts @@ -21,7 +21,6 @@ zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; zephyr,canbus = &twai; - zephyr,bt-hci = &esp32_bt_hci; }; aliases { @@ -123,7 +122,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/seeed/xiao_esp32s3/Kconfig.defconfig b/boards/seeed/xiao_esp32s3/Kconfig.defconfig index b9222985d8d..a1b83409902 100644 --- a/boards/seeed/xiao_esp32s3/Kconfig.defconfig +++ b/boards/seeed/xiao_esp32s3/Kconfig.defconfig @@ -10,6 +10,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_XIAO_ESP32S3_ESP32S3_PROCPU if BOARD_XIAO_ESP32S3_ESP32S3_APPCPU diff --git a/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu.dts b/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu.dts index 831c878d432..ae232f4d228 100644 --- a/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu.dts +++ b/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu.dts @@ -20,7 +20,6 @@ zephyr,shell-uart = &usb_serial; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; aliases { @@ -136,7 +135,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/vcc-gnd/yd_esp32/Kconfig.defconfig b/boards/vcc-gnd/yd_esp32/Kconfig.defconfig index 2ca1ba19036..de2f5af5e75 100644 --- a/boards/vcc-gnd/yd_esp32/Kconfig.defconfig +++ b/boards/vcc-gnd/yd_esp32/Kconfig.defconfig @@ -12,6 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_YD_ESP32_ESP32_PROCPU if BOARD_YD_ESP32_ESP32_APPCPU diff --git a/boards/vcc-gnd/yd_esp32/yd_esp32_procpu.dts b/boards/vcc-gnd/yd_esp32/yd_esp32_procpu.dts index 8560ba7a4f9..2e748af71b9 100644 --- a/boards/vcc-gnd/yd_esp32/yd_esp32_procpu.dts +++ b/boards/vcc-gnd/yd_esp32/yd_esp32_procpu.dts @@ -35,7 +35,6 @@ zephyr,shell-uart = &uart0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; }; }; @@ -183,7 +182,3 @@ }; }; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/boards/waveshare/esp32s3_touch_lcd_1_28/Kconfig.defconfig b/boards/waveshare/esp32s3_touch_lcd_1_28/Kconfig.defconfig index 06c61c850aa..c0de8c41f7a 100644 --- a/boards/waveshare/esp32s3_touch_lcd_1_28/Kconfig.defconfig +++ b/boards/waveshare/esp32s3_touch_lcd_1_28/Kconfig.defconfig @@ -10,6 +10,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 +config BT_ESP32 + default y if BT + endif # BOARD_ESP32S3_TOUCH_LCD_1_28_ESP32S3_PROCPU if BOARD_ESP32S3_TOUCH_LCD_1_28_ESP32S3_APPCPU diff --git a/boards/waveshare/esp32s3_touch_lcd_1_28/esp32s3_touch_lcd_1_28_esp32s3_procpu.dts b/boards/waveshare/esp32s3_touch_lcd_1_28/esp32s3_touch_lcd_1_28_esp32s3_procpu.dts index e4c974f7c19..346c522142f 100644 --- a/boards/waveshare/esp32s3_touch_lcd_1_28/esp32s3_touch_lcd_1_28_esp32s3_procpu.dts +++ b/boards/waveshare/esp32s3_touch_lcd_1_28/esp32s3_touch_lcd_1_28_esp32s3_procpu.dts @@ -30,7 +30,6 @@ zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; zephyr,display = &gc9a01; - zephyr,bt-hci = &esp32_bt_hci; }; /* Buttons */ @@ -183,7 +182,3 @@ &wdt0 { status = "okay"; }; - -&esp32_bt_hci { - status = "okay"; -}; diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index cf04e373d1b..c0c4f162c2a 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -98,8 +98,6 @@ config BT_USERCHAN config BT_ESP32 bool "ESP32 HCI driver" - default y - depends on DT_HAS_ESPRESSIF_ESP32_BT_HCI_ENABLED help Espressif HCI bluetooth interface diff --git a/drivers/bluetooth/hci/hci_esp32.c b/drivers/bluetooth/hci/hci_esp32.c index 7536e9f7622..311dddf916c 100644 --- a/drivers/bluetooth/hci/hci_esp32.c +++ b/drivers/bluetooth/hci/hci_esp32.c @@ -9,7 +9,7 @@ #include #include -#include +#include #include @@ -17,14 +17,8 @@ #include LOG_MODULE_REGISTER(bt_hci_driver_esp32); -#define DT_DRV_COMPAT espressif_esp32_bt_hci - #define HCI_BT_ESP32_TIMEOUT K_MSEC(2000) -struct bt_esp32_data { - bt_hci_recv_t recv; -}; - static K_SEM_DEFINE(hci_send_sem, 1, 1); static bool is_hci_event_discardable(const uint8_t *evt_data) @@ -186,8 +180,6 @@ static struct net_buf *bt_esp_iso_recv(uint8_t *data, size_t remaining) static int hci_esp_host_rcv_pkt(uint8_t *data, uint16_t len) { - const struct device *dev = DEVICE_DT_GET(DT_DRV_INST(0)); - struct bt_esp32_data *hci = dev->data; uint8_t pkt_indicator; struct net_buf *buf = NULL; size_t remaining = len; @@ -218,7 +210,7 @@ static int hci_esp_host_rcv_pkt(uint8_t *data, uint16_t len) if (buf) { LOG_DBG("Calling bt_recv(%p)", buf); - hci->recv(dev, buf); + bt_recv(buf); } return 0; @@ -234,7 +226,7 @@ static esp_vhci_host_callback_t vhci_host_cb = { hci_esp_host_rcv_pkt }; -static int bt_esp32_send(const struct device *dev, struct net_buf *buf) +static int bt_esp32_send(struct net_buf *buf) { int err = 0; uint8_t pkt_indicator; @@ -324,9 +316,8 @@ static int bt_esp32_ble_deinit(void) return 0; } -static int bt_esp32_open(const struct device *dev, bt_hci_recv_t recv) +static int bt_esp32_open(void) { - struct bt_esp32_data *hci = dev->data; int err; err = bt_esp32_ble_init(); @@ -334,16 +325,13 @@ static int bt_esp32_open(const struct device *dev, bt_hci_recv_t recv) return err; } - hci->recv = recv; - LOG_DBG("ESP32 BT started"); return 0; } -static int bt_esp32_close(const struct device *dev) +static int bt_esp32_close(void) { - struct bt_esp32_data *hci = dev->data; int err; err = bt_esp32_ble_deinit(); @@ -351,24 +339,27 @@ static int bt_esp32_close(const struct device *dev) return err; } - hci->recv = NULL; - LOG_DBG("ESP32 BT stopped"); return 0; } -static const struct bt_hci_driver_api drv = { +static const struct bt_hci_driver drv = { + .name = "BT ESP32", .open = bt_esp32_open, .send = bt_esp32_send, .close = bt_esp32_close, + .bus = BT_HCI_DRIVER_BUS_IPM, +#if defined(CONFIG_BT_DRIVER_QUIRK_NO_AUTO_DLE) + .quirks = BT_QUIRK_NO_AUTO_DLE, +#endif }; -#define BT_ESP32_DEVICE_INIT(inst) \ - static struct bt_esp32_data bt_esp32_data_##inst = { \ - }; \ - DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &bt_esp32_data_##inst, NULL, \ - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &drv) +static int bt_esp32_init(void) +{ + bt_hci_driver_register(&drv); + + return 0; +} -/* Only one instance supported */ -BT_ESP32_DEVICE_INIT(0) +SYS_INIT(bt_esp32_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/dts/bindings/bluetooth/espressif,esp32-bt-hci.yaml b/dts/bindings/bluetooth/espressif,esp32-bt-hci.yaml deleted file mode 100644 index e095fcd9510..00000000000 --- a/dts/bindings/bluetooth/espressif,esp32-bt-hci.yaml +++ /dev/null @@ -1,13 +0,0 @@ -description: Bluetooth HCI for Espressif ESP32 - -compatible: "espressif,esp32-bt-hci" - -include: bt-hci.yaml - -properties: - bt-hci-name: - default: "BT ESP32" - bt-hci-bus: - default: "BT_HCI_BUS_IPM" - bt-hci-quirks: - default: ["BT_HCI_QUIRK_NO_AUTO_DLE"] diff --git a/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi b/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi index c4ac113ccc3..6ad2f612866 100644 --- a/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi +++ b/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi @@ -23,7 +23,6 @@ zephyr,canbus = &twai; zephyr,entropy = &trng0; zephyr,flash-controller = &flash; - zephyr,bt-hci = &esp32_bt_hci; }; cpus { @@ -65,11 +64,6 @@ status = "disabled"; }; - esp32_bt_hci: esp32_bt_hci { - compatible = "espressif,esp32-bt-hci"; - status = "disabled"; - }; - soc { #address-cells = <1>; #size-cells = <1>; diff --git a/dts/xtensa/espressif/esp32/esp32_common.dtsi b/dts/xtensa/espressif/esp32/esp32_common.dtsi index 64be47fa57c..82a92ed00a8 100644 --- a/dts/xtensa/espressif/esp32/esp32_common.dtsi +++ b/dts/xtensa/espressif/esp32/esp32_common.dtsi @@ -18,7 +18,6 @@ zephyr,canbus = &twai; zephyr,entropy = &trng0; zephyr,flash-controller = &flash; - zephyr,bt-hci = &esp32_bt_hci; }; cpus { @@ -60,11 +59,6 @@ status = "disabled"; }; - esp32_bt_hci: esp32_bt_hci { - compatible = "espressif,esp32-bt-hci"; - status = "disabled"; - }; - eth: eth { compatible = "espressif,esp32-eth"; interrupts = ; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi index 861537164fe..1bb8c000ed5 100644 --- a/dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi +++ b/dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi @@ -59,11 +59,6 @@ status = "disabled"; }; - esp32_bt_hci: esp32_bt_hci { - compatible = "espressif,esp32-bt-hci"; - status = "disabled"; - }; - pinctrl: pin-controller { compatible = "espressif,esp32-pinctrl"; status = "okay"; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi index 686d04137fe..b02d38410ad 100644 --- a/dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi +++ b/dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi @@ -63,11 +63,6 @@ status = "disabled"; }; - esp32_bt_hci: esp32_bt_hci { - compatible = "espressif,esp32-bt-hci"; - status = "disabled"; - }; - pinctrl: pin-controller { compatible = "espressif,esp32-pinctrl"; status = "okay"; From 4ad7d34c8b42808378e46cb0ee8ff8f2f7cc7da8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 237/825] Revert "[nrf fromtree] Bluetooth: drivers: Convert psoc6_bless driver to new API" This reverts commit 4a058fa39181c3d601d4e3526223a3aefc7c9ca9. --- .../cy8cproto_063_ble/Kconfig.defconfig | 3 +- .../cy8cproto_063_ble/cy8cproto_063_ble.dts | 1 - drivers/bluetooth/hci/Kconfig | 2 - drivers/bluetooth/hci/hci_psoc6_bless.c | 52 +++++++------------ .../bluetooth/infineon,cat1-bless-hci.yaml | 8 +-- 5 files changed, 21 insertions(+), 45 deletions(-) diff --git a/boards/infineon/cy8cproto_063_ble/Kconfig.defconfig b/boards/infineon/cy8cproto_063_ble/Kconfig.defconfig index 4123455e9f9..a93950668b8 100644 --- a/boards/infineon/cy8cproto_063_ble/Kconfig.defconfig +++ b/boards/infineon/cy8cproto_063_ble/Kconfig.defconfig @@ -6,6 +6,7 @@ if BOARD_CY8CPROTO_063_BLE -# No defaults to change for now +config BT_PSOC6_BLESS + default y if BT endif # BOARD_CY8CPROTO_063_BLE diff --git a/boards/infineon/cy8cproto_063_ble/cy8cproto_063_ble.dts b/boards/infineon/cy8cproto_063_ble/cy8cproto_063_ble.dts index 5516895fddd..0f96ff07a77 100644 --- a/boards/infineon/cy8cproto_063_ble/cy8cproto_063_ble.dts +++ b/boards/infineon/cy8cproto_063_ble/cy8cproto_063_ble.dts @@ -27,7 +27,6 @@ zephyr,flash = &flash0; zephyr,console = &uart5; zephyr,shell-uart = &uart5; - zephyr,bt-hci = &bluetooth; }; /delete-node/ cpu@0; diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index c0c4f162c2a..11482b41f1d 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -103,8 +103,6 @@ config BT_ESP32 config BT_PSOC6_BLESS bool "PSOC6 BLESS driver" - default y - depends on DT_HAS_INFINEON_CAT1_BLESS_HCI_ENABLED select BT_HCI_SETUP help PSOC6 BLESS driver with BLE Controller which operates in diff --git a/drivers/bluetooth/hci/hci_psoc6_bless.c b/drivers/bluetooth/hci/hci_psoc6_bless.c index 5f4d1fdd13d..af6804f2f17 100644 --- a/drivers/bluetooth/hci/hci_psoc6_bless.c +++ b/drivers/bluetooth/hci/hci_psoc6_bless.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -32,10 +32,6 @@ LOG_MODULE_REGISTER(psoc6_bless); #define DT_DRV_COMPAT infineon_cat1_bless_hci -struct psoc6_bless_data { - bt_hci_recv_t recv; -}; - #define BLE_LOCK_TMOUT_MS (1000) #define BLE_THREAD_SEM_TMOUT_MS (1000) @@ -98,8 +94,6 @@ static void psoc6_bless_isr_handler(const struct device *dev) static void psoc6_bless_events_handler(uint32_t eventCode, void *eventParam) { - const struct device *dev = DEVICE_DT_GET(DT_DRV_INST(0)); - struct psoc6_bless_data *hci = dev->data; cy_stc_ble_hci_tx_packet_info_t *hci_rx = NULL; struct net_buf *buf = NULL; size_t buf_tailroom = 0; @@ -141,16 +135,13 @@ static void psoc6_bless_events_handler(uint32_t eventCode, void *eventParam) return; } net_buf_add_mem(buf, hci_rx->data, hci_rx->dataLength); - hci->recv(dev, buf); + bt_recv(buf); } -static int psoc6_bless_open(const struct device *dev, bt_hci_recv_t recv) +static int psoc6_bless_open(void) { - struct psoc6_bless_data *hci = dev->data; k_tid_t tid; - hci->recv = recv; - tid = k_thread_create(&psoc6_bless_rx_thread_data, psoc6_bless_rx_thread_stack, K_KERNEL_STACK_SIZEOF(psoc6_bless_rx_thread_stack), psoc6_bless_rx_thread, NULL, NULL, NULL, @@ -160,12 +151,10 @@ static int psoc6_bless_open(const struct device *dev, bt_hci_recv_t recv) return 0; } -static int psoc6_bless_send(const struct device *dev, struct net_buf *buf) +static int psoc6_bless_send(struct net_buf *buf) { cy_en_ble_api_result_t result; - ARG_UNUSED(dev); - memset(&hci_tx_pkt, 0, sizeof(cy_stc_ble_hci_tx_packet_info_t)); hci_tx_pkt.dataLength = buf->len; @@ -201,9 +190,8 @@ static int psoc6_bless_send(const struct device *dev, struct net_buf *buf) return 0; } -static int psoc6_bless_setup(const struct device *dev, const struct bt_hci_setup_params *params) +static int psoc6_bless_setup(const struct bt_hci_setup_params *params) { - ARG_UNUSED(dev); ARG_UNUSED(params); struct net_buf *buf; int err; @@ -229,11 +217,17 @@ static int psoc6_bless_setup(const struct device *dev, const struct bt_hci_setup return 0; } -static int psoc6_bless_hci_init(const struct device *dev) +static int psoc6_bless_hci_init(void) { cy_en_ble_api_result_t result; - - ARG_UNUSED(dev); + static const struct bt_hci_driver drv = { + .name = "PSoC 6 BLESS", + .bus = BT_HCI_DRIVER_BUS_VIRTUAL, + .quirks = BT_QUIRK_NO_RESET, + .open = psoc6_bless_open, + .send = psoc6_bless_send, + .setup = psoc6_bless_setup, + }; /* Connect BLE interrupt to ISR */ IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), psoc6_bless_isr_handler, 0, 0); @@ -258,20 +252,10 @@ static int psoc6_bless_hci_init(const struct device *dev) /* Enables BLE Low-power mode (LPM)*/ Cy_BLE_EnableLowPowerMode(); + /* Register a BLESS HCI driver to the Bluetooth stack. */ + bt_hci_driver_register(&drv); + return 0; } -static const struct bt_hci_driver_api drv = { - .open = psoc6_bless_open, - .send = psoc6_bless_send, - .setup = psoc6_bless_setup, -}; - -#define PSOC6_BLESS_DEVICE_INIT(inst) \ - static struct psoc6_bless_data psoc6_bless_data_##inst = { \ - }; \ - DEVICE_DT_INST_DEFINE(inst, psoc6_bless_hci_init, NULL, &psoc6_bless_data_##inst, NULL, \ - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &drv) - -/* Only one instance supported */ -PSOC6_BLESS_DEVICE_INIT(0) +SYS_INIT(psoc6_bless_hci_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/dts/bindings/bluetooth/infineon,cat1-bless-hci.yaml b/dts/bindings/bluetooth/infineon,cat1-bless-hci.yaml index 80671e58135..0d38855c00e 100644 --- a/dts/bindings/bluetooth/infineon,cat1-bless-hci.yaml +++ b/dts/bindings/bluetooth/infineon,cat1-bless-hci.yaml @@ -8,14 +8,8 @@ description: | compatible: "infineon,cat1-bless-hci" -include: bt-hci.yaml +include: base.yaml properties: - bt-hci-name: - default: "PSoC 6 BLESS" - bt-hci-bus: - default: "BT_HCI_BUS_VIRTUAL" - bt-hci-quirks: - default: ["BT_HCI_QUIRK_NO_RESET"] interrupts: required: true From 64402e88b7eb6a5622e7d536713811e5e598b531 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 238/825] Revert "[nrf fromtree] Bluetooth: drivers: Convert IPC driver to new API" This reverts commit ca3755d15f935bcad0e583bd378d3647f61be3bb. --- .../bl5340_dvk_nrf5340_cpuapp_common.dtsi | 2 +- .../nrf_bsim/nrf5340bsim_nrf5340_cpuapp.dts | 2 +- ...rf5340_audio_dk_nrf5340_cpuapp_common.dtsi | 2 +- .../nrf5340dk/nrf5340_cpuapp_common.dtsi | 2 +- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts | 7 +- .../thingy53/thingy53_nrf5340_common.dtsi | 1 - .../pan1783_nrf5340_cpuapp_common.dtsi | 2 +- ...tac_mdbt53_db_40_nrf5340_cpuapp_common.dts | 2 +- ...ac_mdbt53v_db_40_nrf5340_cpuapp_common.dts | 2 +- drivers/bluetooth/hci/Kconfig | 2 - drivers/bluetooth/hci/ipc.c | 104 +++++++++--------- dts/arm/nordic/nrf5340_cpuapp_ipc.dtsi | 5 - dts/bindings/bluetooth/zephyr,bt-hci-ipc.yaml | 17 --- .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 5 - .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 5 - .../nrf5340dk_nrf5340_cpuapp_icbmsg.overlay | 5 - .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 5 - .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 5 - 18 files changed, 58 insertions(+), 117 deletions(-) delete mode 100644 dts/bindings/bluetooth/zephyr,bt-hci-ipc.yaml diff --git a/boards/lairdconnect/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi b/boards/lairdconnect/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi index 8a7f52a224e..ff29e1f176e 100644 --- a/boards/lairdconnect/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi +++ b/boards/lairdconnect/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_common.dtsi @@ -15,7 +15,7 @@ zephyr,bt-mon-uart = &uart0; zephyr,bt-c2h-uart = &uart0; zephyr,display = &ili9340; - zephyr,bt-hci = &bt_hci_ipc0; + zephyr,bt-hci-ipc = &ipc0; }; /* Main LEDs and buttons are on an I2C TCA9538 GPIO port expander */ diff --git a/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpuapp.dts b/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpuapp.dts index 11073e6182d..aa1f235e16e 100644 --- a/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpuapp.dts +++ b/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpuapp.dts @@ -43,7 +43,7 @@ chosen { zephyr,entropy = &rng_hci; zephyr,flash = &flash0; - zephyr,bt-hci = &bt_hci_ipc0; + zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,ieee802154 = &ieee802154; }; diff --git a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_common.dtsi b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_common.dtsi index 7f62b862639..8504e23ed7e 100644 --- a/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_common.dtsi +++ b/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_common.dtsi @@ -13,7 +13,7 @@ zephyr,uart-mcumgr = &uart0; zephyr,bt-mon-uart = &uart0; zephyr,bt-c2h-uart = &uart0; - zephyr,bt-hci = &bt_hci_ipc0; + zephyr,bt-hci-ipc = &ipc0; watchdog0 = &wdt0; }; diff --git a/boards/nordic/nrf5340dk/nrf5340_cpuapp_common.dtsi b/boards/nordic/nrf5340dk/nrf5340_cpuapp_common.dtsi index 59436374f2c..70ba3252450 100644 --- a/boards/nordic/nrf5340dk/nrf5340_cpuapp_common.dtsi +++ b/boards/nordic/nrf5340dk/nrf5340_cpuapp_common.dtsi @@ -14,7 +14,7 @@ zephyr,uart-mcumgr = &uart0; zephyr,bt-mon-uart = &uart0; zephyr,bt-c2h-uart = &uart0; - zephyr,bt-hci = &bt_hci_ipc0; + zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,ieee802154 = &ieee802154; }; diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts index 88342e03adc..772fb1b36bf 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuapp.dts @@ -26,7 +26,7 @@ zephyr,sram = &cpuapp_data; zephyr,shell-uart = &uart136; zephyr,ieee802154 = &cpuapp_ieee802154; - zephyr,bt-hci = &bt_hci_ipc0; + zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,canbus = &can120; zephyr,entropy = &prng; @@ -162,11 +162,6 @@ ipc0: &cpuapp_cpurad_ipc { rx-region = <&cpurad_cpuapp_ipc_shm>; tx-blocks = <32>; rx-blocks = <32>; - - bt_hci_ipc0: bt_hci_ipc0 { - compatible = "zephyr,bt-hci-ipc"; - status = "okay"; - }; }; &cpuapp_cpusys_ipc { diff --git a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi index 26afaee2b0e..54efd588cf7 100644 --- a/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi +++ b/boards/nordic/thingy53/thingy53_nrf5340_common.dtsi @@ -14,7 +14,6 @@ zephyr,bt-mon-uart = &cdc_acm_uart; zephyr,bt-c2h-uart = &cdc_acm_uart; zephyr,bt-hci-ipc = &ipc0; - zephyr,bt-hci = &bt_hci_ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,ieee802154 = &ieee802154; nordic,pm-ext-flash = &mx25r64; diff --git a/boards/panasonic/pan1783/pan1783_nrf5340_cpuapp_common.dtsi b/boards/panasonic/pan1783/pan1783_nrf5340_cpuapp_common.dtsi index 315e1c8372a..fae7f566fcc 100644 --- a/boards/panasonic/pan1783/pan1783_nrf5340_cpuapp_common.dtsi +++ b/boards/panasonic/pan1783/pan1783_nrf5340_cpuapp_common.dtsi @@ -14,7 +14,7 @@ zephyr,uart-mcumgr = &uart0; zephyr,bt-mon-uart = &uart0; zephyr,bt-c2h-uart = &uart0; - zephyr,bt-hci = &bt_hci_ipc0; + zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,ieee802154 = &ieee802154; }; diff --git a/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpuapp_common.dts b/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpuapp_common.dts index 62a49e52069..3af7de1f17e 100644 --- a/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpuapp_common.dts +++ b/boards/raytac/mdbt53_db_40/raytac_mdbt53_db_40_nrf5340_cpuapp_common.dts @@ -14,7 +14,7 @@ zephyr,uart-mcumgr = &uart0; zephyr,bt-mon-uart = &uart0; zephyr,bt-c2h-uart = &uart0; - zephyr,bt-hci = &bt_hci_ipc0; + zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,ieee802154 = &ieee802154; }; diff --git a/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpuapp_common.dts b/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpuapp_common.dts index 3c1b42307a6..c7d7521d08b 100644 --- a/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpuapp_common.dts +++ b/boards/raytac/mdbt53v_db_40/raytac_mdbt53v_db_40_nrf5340_cpuapp_common.dts @@ -14,7 +14,7 @@ zephyr,uart-mcumgr = &uart0; zephyr,bt-mon-uart = &uart0; zephyr,bt-c2h-uart = &uart0; - zephyr,bt-hci = &bt_hci_ipc0; + zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,ieee802154 = &ieee802154; }; diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index 11482b41f1d..75b3ec86521 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -38,8 +38,6 @@ config BT_RPMSG config BT_HCI_IPC bool "HCI using the IPC subsystem" - default y - depends on DT_HAS_ZEPHYR_BT_HCI_IPC_ENABLED select BT_HAS_HCI_VS select IPC_SERVICE select MBOX diff --git a/drivers/bluetooth/hci/ipc.c b/drivers/bluetooth/hci/ipc.c index 9d63d12ec32..54a8556d138 100644 --- a/drivers/bluetooth/hci/ipc.c +++ b/drivers/bluetooth/hci/ipc.c @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include @@ -18,17 +18,10 @@ #include LOG_MODULE_REGISTER(bt_hci_driver); -#define DT_DRV_COMPAT zephyr_bt_hci_ipc - #define IPC_BOUND_TIMEOUT_IN_MS K_MSEC(1000) -struct ipc_data { - bt_hci_recv_t recv; - struct ipc_ept hci_ept; - struct ipc_ept_cfg hci_ept_cfg; - struct k_sem bound_sem; - const struct device *ipc; -}; +static struct ipc_ept hci_ept; +static K_SEM_DEFINE(ipc_bound_sem, 0, 1); static bool is_hci_event_discardable(const uint8_t *evt_data) { @@ -207,9 +200,8 @@ static struct net_buf *bt_ipc_iso_recv(const uint8_t *data, size_t remaining) return buf; } -static void bt_ipc_rx(const struct device *dev, const uint8_t *data, size_t len) +static void bt_ipc_rx(const uint8_t *data, size_t len) { - struct ipc_data *ipc = dev->data; uint8_t pkt_indicator; struct net_buf *buf = NULL; size_t remaining = len; @@ -239,15 +231,14 @@ static void bt_ipc_rx(const struct device *dev, const uint8_t *data, size_t len) if (buf) { LOG_DBG("Calling bt_recv(%p)", buf); - ipc->recv(dev, buf); + bt_recv(buf); LOG_HEXDUMP_DBG(buf->data, buf->len, "RX buf payload:"); } } -static int bt_ipc_send(const struct device *dev, struct net_buf *buf) +static int bt_ipc_send(struct net_buf *buf) { - struct ipc_data *data = dev->data; int err; uint8_t pkt_indicator; @@ -270,7 +261,7 @@ static int bt_ipc_send(const struct device *dev, struct net_buf *buf) net_buf_push_u8(buf, pkt_indicator); LOG_HEXDUMP_DBG(buf->data, buf->len, "Final HCI buffer:"); - err = ipc_service_send(&data->hci_ept, buf->data, buf->len); + err = ipc_service_send(&hci_ept, buf->data, buf->len); if (err < 0) { LOG_ERR("Failed to send (err %d)", err); } @@ -282,19 +273,22 @@ static int bt_ipc_send(const struct device *dev, struct net_buf *buf) static void hci_ept_bound(void *priv) { - const struct device *dev = priv; - struct ipc_data *ipc = dev->data; - - k_sem_give(&ipc->bound_sem); + k_sem_give(&ipc_bound_sem); } static void hci_ept_recv(const void *data, size_t len, void *priv) { - const struct device *dev = priv; - - bt_ipc_rx(dev, data, len); + bt_ipc_rx(data, len); } +static struct ipc_ept_cfg hci_ept_cfg = { + .name = "nrf_bt_hci", + .cb = { + .bound = hci_ept_bound, + .received = hci_ept_recv, + }, +}; + int __weak bt_hci_transport_setup(const struct device *dev) { ARG_UNUSED(dev); @@ -307,11 +301,13 @@ int __weak bt_hci_transport_teardown(const struct device *dev) return 0; } -static int bt_ipc_open(const struct device *dev, bt_hci_recv_t recv) +static int bt_ipc_open(void) { - struct ipc_data *ipc = dev->data; int err; + const struct device *hci_ipc_instance = + DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_hci_ipc)); + err = bt_hci_transport_setup(NULL); if (err) { LOG_ERR("HCI transport setup failed with: %d\n", err); @@ -320,32 +316,29 @@ static int bt_ipc_open(const struct device *dev, bt_hci_recv_t recv) LOG_DBG(""); - err = ipc_service_open_instance(ipc->ipc); + err = ipc_service_open_instance(hci_ipc_instance); if (err && (err != -EALREADY)) { LOG_ERR("IPC service instance initialization failed: %d\n", err); return err; } - err = ipc_service_register_endpoint(ipc->ipc, &ipc->hci_ept, &ipc->hci_ept_cfg); + err = ipc_service_register_endpoint(hci_ipc_instance, &hci_ept, &hci_ept_cfg); if (err) { LOG_ERR("Registering endpoint failed with %d", err); return err; } - err = k_sem_take(&ipc->bound_sem, IPC_BOUND_TIMEOUT_IN_MS); + err = k_sem_take(&ipc_bound_sem, IPC_BOUND_TIMEOUT_IN_MS); if (err) { LOG_ERR("Endpoint binding failed with %d", err); return err; } - ipc->recv = recv; - return 0; } -static int bt_ipc_close(const struct device *dev) +static int bt_ipc_close(void) { - struct ipc_data *ipc = dev->data; int err; if (IS_ENABLED(CONFIG_BT_HCI_HOST)) { @@ -356,13 +349,16 @@ static int bt_ipc_close(const struct device *dev) } } - err = ipc_service_deregister_endpoint(&ipc->hci_ept); + err = ipc_service_deregister_endpoint(&hci_ept); if (err) { LOG_ERR("Deregistering HCI endpoint failed with: %d", err); return err; } - err = ipc_service_close_instance(ipc->ipc); + const struct device *hci_ipc_instance = + DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_hci_ipc)); + + err = ipc_service_close_instance(hci_ipc_instance); if (err) { LOG_ERR("Closing IPC service failed with: %d", err); return err; @@ -374,31 +370,31 @@ static int bt_ipc_close(const struct device *dev) return err; } - ipc->recv = NULL; - return 0; } -static const struct bt_hci_driver_api drv = { +static const struct bt_hci_driver drv = { + .name = "IPC", .open = bt_ipc_open, .close = bt_ipc_close, .send = bt_ipc_send, + .bus = BT_HCI_DRIVER_BUS_IPM, +#if defined(CONFIG_BT_DRIVER_QUIRK_NO_AUTO_DLE) + .quirks = BT_QUIRK_NO_AUTO_DLE, +#endif }; -#define IPC_DEVICE_INIT(inst) \ - static struct ipc_data ipc_data_##inst = { \ - .bound_sem = Z_SEM_INITIALIZER(ipc_data_##inst.bound_sem, 0, 1), \ - .hci_ept_cfg = { \ - .name = DT_INST_PROP(inst, bt_hci_ipc_name), \ - .cb = { \ - .bound = hci_ept_bound, \ - .received = hci_ept_recv, \ - }, \ - .priv = (void *)DEVICE_DT_INST_GET(inst), \ - }, \ - .ipc = DEVICE_DT_GET(DT_INST_PARENT(inst)), \ - }; \ - DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &ipc_data_##inst, NULL, \ - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &drv) - -DT_INST_FOREACH_STATUS_OKAY(IPC_DEVICE_INIT) +static int bt_ipc_init(void) +{ + + int err; + + err = bt_hci_driver_register(&drv); + if (err < 0) { + LOG_ERR("Failed to register BT HIC driver (err %d)", err); + } + + return err; +} + +SYS_INIT(bt_ipc_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/dts/arm/nordic/nrf5340_cpuapp_ipc.dtsi b/dts/arm/nordic/nrf5340_cpuapp_ipc.dtsi index f5cda20e961..9dc8f70a7d0 100644 --- a/dts/arm/nordic/nrf5340_cpuapp_ipc.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp_ipc.dtsi @@ -11,9 +11,4 @@ ipc0: ipc0 { mbox-names = "tx", "rx"; role = "host"; status = "okay"; - - bt_hci_ipc0: bt_hci_ipc0 { - compatible = "zephyr,bt-hci-ipc"; - status = "okay"; - }; }; diff --git a/dts/bindings/bluetooth/zephyr,bt-hci-ipc.yaml b/dts/bindings/bluetooth/zephyr,bt-hci-ipc.yaml deleted file mode 100644 index 88780827ce4..00000000000 --- a/dts/bindings/bluetooth/zephyr,bt-hci-ipc.yaml +++ /dev/null @@ -1,17 +0,0 @@ -description: Bluetooth HCI using the IPC subsystem - -compatible: "zephyr,bt-hci-ipc" - -include: bt-hci.yaml - -properties: - bt-hci-name: - default: "IPC" - bt-hci-bus: - default: "BT_HCI_BUS_IPM" - bt-hci-quirks: - default: ["BT_HCI_QUIRK_NO_AUTO_DLE"] - bt-hci-ipc-name: - type: string - default: "nrf_bt_hci" - description: IPC endpoint name diff --git a/samples/subsys/ipc/ipc_service/icmsg/boards/nrf5340dk_nrf5340_cpuapp.overlay b/samples/subsys/ipc/ipc_service/icmsg/boards/nrf5340dk_nrf5340_cpuapp.overlay index f782bdd8578..22650211611 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/samples/subsys/ipc/ipc_service/icmsg/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -31,11 +31,6 @@ mboxes = <&mbox 0>, <&mbox 1>; mbox-names = "tx", "rx"; status = "okay"; - - bt_hci_ipc0: bt_hci_ipc0 { - compatible = "zephyr,bt-hci-ipc"; - status = "okay"; - }; }; }; }; diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf5340dk_nrf5340_cpuapp.overlay b/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf5340dk_nrf5340_cpuapp.overlay index 216561b349b..35cffd8ad35 100644 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -39,11 +39,6 @@ mboxes = <&mbox 0>, <&mbox 1>; mbox-names = "tx", "rx"; status = "okay"; - - bt_hci_ipc0: bt_hci_ipc0 { - compatible = "zephyr,bt-hci-ipc"; - status = "okay"; - }; }; ipc1: ipc1 { diff --git a/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf5340dk_nrf5340_cpuapp_icbmsg.overlay b/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf5340dk_nrf5340_cpuapp_icbmsg.overlay index 2d85fbbf79c..3db9db032f4 100644 --- a/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf5340dk_nrf5340_cpuapp_icbmsg.overlay +++ b/samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf5340dk_nrf5340_cpuapp_icbmsg.overlay @@ -41,11 +41,6 @@ mboxes = <&mbox 0>, <&mbox 1>; mbox-names = "tx", "rx"; status = "okay"; - - bt_hci_ipc0: bt_hci_ipc0 { - compatible = "zephyr,bt-hci-ipc"; - status = "okay"; - }; }; ipc1: ipc1 { diff --git a/samples/subsys/ipc/ipc_service/static_vrings/boards/nrf5340dk_nrf5340_cpuapp.overlay b/samples/subsys/ipc/ipc_service/static_vrings/boards/nrf5340dk_nrf5340_cpuapp.overlay index f07f75fc9a1..520f007a821 100644 --- a/samples/subsys/ipc/ipc_service/static_vrings/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/samples/subsys/ipc/ipc_service/static_vrings/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -33,11 +33,6 @@ mbox-names = "tx", "rx"; role = "host"; status = "okay"; - - bt_hci_ipc0: bt_hci_ipc0 { - compatible = "zephyr,bt-hci-ipc"; - status = "okay"; - }; }; ipc1: ipc1 { diff --git a/samples/subsys/logging/multidomain/boards/nrf5340dk_nrf5340_cpuapp.overlay b/samples/subsys/logging/multidomain/boards/nrf5340dk_nrf5340_cpuapp.overlay index 75e9f1b5744..eac4af423ae 100644 --- a/samples/subsys/logging/multidomain/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/samples/subsys/logging/multidomain/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -34,11 +34,6 @@ mbox-names = "tx", "rx"; role = "host"; status = "okay"; - - bt_hci_ipc0: bt_hci_ipc0 { - status = "okay"; - compatible = "zephyr,bt-hci-ipc"; - }; }; ipc1: ipc1 { From e3648899fc7524e363f7c580adae004545c9c38f Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 239/825] Revert "[nrf fromtree] Bluetooth: Use device tree to indicate vendor exension support" This reverts commit 010d1b79ea4541b6386a05bb891e1990d2267f3b. --- dts/bindings/bluetooth/bt-hci.yaml | 3 --- subsys/bluetooth/common/Kconfig | 4 ---- 2 files changed, 7 deletions(-) diff --git a/dts/bindings/bluetooth/bt-hci.yaml b/dts/bindings/bluetooth/bt-hci.yaml index e53b9022e90..d87a31ddacd 100644 --- a/dts/bindings/bluetooth/bt-hci.yaml +++ b/dts/bindings/bluetooth/bt-hci.yaml @@ -23,6 +23,3 @@ properties: bt-hci-quirks: type: string-array description: HCI device quirks - bt-hci-vs-ext: - type: boolean - description: Zephyr HCI vendor extensions are supported diff --git a/subsys/bluetooth/common/Kconfig b/subsys/bluetooth/common/Kconfig index ce64b4d70c8..9ccd4e184f6 100644 --- a/subsys/bluetooth/common/Kconfig +++ b/subsys/bluetooth/common/Kconfig @@ -175,12 +175,8 @@ config BT_BUF_CMD_TX_COUNT endmenu -# Workaround to have commas on function arguments -ZEPHYR_BT_HCI := zephyr,bt-hci - config BT_HAS_HCI_VS bool - default $(dt_chosen_bool_prop,$(ZEPHYR_BT_HCI),bt-hci-vs-ext) help This option is set by the Bluetooth controller to indicate support for the Zephyr HCI Vendor-Specific Commands and Event. From 6ad28f3f5dd6453f628459276c79e54aed7391ad Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 240/825] Revert "[nrf fromtree] Bluetooth: Kconfig: Remove BT_NO_DRIVER" This reverts commit 28726cebb21ca4ea36f0d9a4eaeac5267ffc2af0. --- drivers/bluetooth/hci/Kconfig | 7 +++++++ .../boards/unit_testing/unit_testing/Kconfig.defconfig | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index 75b3ec86521..9b4a2938457 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -117,6 +117,13 @@ config BT_NXP help NXP HCI bluetooth interface +config BT_NO_DRIVER + bool "No default HCI driver" + select BT_HAS_HCI_VS + help + This is intended for unit tests where no internal driver + should be selected. + config BT_AMBIQ_HCI bool "AMBIQ BT HCI driver" select SPI diff --git a/subsys/testsuite/boards/unit_testing/unit_testing/Kconfig.defconfig b/subsys/testsuite/boards/unit_testing/unit_testing/Kconfig.defconfig index 8bc3b63d778..874e5591893 100644 --- a/subsys/testsuite/boards/unit_testing/unit_testing/Kconfig.defconfig +++ b/subsys/testsuite/boards/unit_testing/unit_testing/Kconfig.defconfig @@ -7,6 +7,5 @@ config BT_CTLR_HCI default n -# Bluetooth unit tests assume HCI vendor extensions are available -config BT_HAS_HCI_VS +config BT_NO_DRIVER default y From 424081cdcac99c2bfcc493167de4da0abea355a5 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 241/825] Revert "[nrf fromtree] drivers: hci: Add NXP HCI driver" This reverts commit 3988850e7679d53b74e1fc6b49651823bf36e7e5. --- drivers/bluetooth/hci/CMakeLists.txt | 1 - drivers/bluetooth/hci/Kconfig | 16 +- drivers/bluetooth/hci/Kconfig.nxp | 24 -- drivers/bluetooth/hci/hci_nxp.c | 417 --------------------------- west.yml | 2 +- 5 files changed, 8 insertions(+), 452 deletions(-) delete mode 100644 drivers/bluetooth/hci/Kconfig.nxp delete mode 100644 drivers/bluetooth/hci/hci_nxp.c diff --git a/drivers/bluetooth/hci/CMakeLists.txt b/drivers/bluetooth/hci/CMakeLists.txt index 94210e79631..6070ffd40b9 100644 --- a/drivers/bluetooth/hci/CMakeLists.txt +++ b/drivers/bluetooth/hci/CMakeLists.txt @@ -33,4 +33,3 @@ zephyr_library_sources_ifdef(CONFIG_BT_PSOC6_BLESS hci_psoc6_bless.c) zephyr_library_sources_ifdef(CONFIG_SOC_NRF5340_CPUAPP nrf53_support.c) zephyr_library_sources_ifdef(CONFIG_BT_AMBIQ_HCI hci_ambiq.c apollox_blue.c) zephyr_library_sources_ifdef(CONFIG_BT_DA1469X hci_da1469x.c) -zephyr_library_sources_ifdef(CONFIG_BT_NXP hci_nxp.c) diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index 9b4a2938457..a86afba4c16 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -112,11 +112,6 @@ config BT_DA1469X Bluetooth HCI driver for communication with CMAC core on DA1469x MCU. -config BT_NXP - bool "NXP HCI driver" - help - NXP HCI bluetooth interface - config BT_NO_DRIVER bool "No default HCI driver" select BT_HAS_HCI_VS @@ -149,12 +144,16 @@ config BT_BLUENRG_ACI endif # BT_SPI +if BT_AMBIQ_HCI + config BT_HCI_INIT_PRIORITY int "BT HCI init priority" - default 75 if BT_AMBIQ_HCI - default KERNEL_INIT_PRIORITY_DEVICE + default 75 help - The priority of BT HCI driver initialization. + The priority of BT HCI driver initialization needs to be lower than + the SPI, GPIO, clock controller drivers initialization priorities. + +endif # BT_AMBIQ_HCI config BT_STM32_IPM_RX_STACK_SIZE int "STM32 IPM stack size for RX thread" @@ -174,7 +173,6 @@ menuconfig BT_AIROC IEEE 802.11a/b/g/n/ac/ax Wi-Fi and Bluetooth® 5.2 in a single-chip solution to enable small-form-factor IoT designs. source "drivers/bluetooth/hci/Kconfig.infineon" -source "drivers/bluetooth/hci/Kconfig.nxp" config BT_DRIVER_QUIRK_NO_AUTO_DLE bool "Host auto-initiated Data Length Update quirk" diff --git a/drivers/bluetooth/hci/Kconfig.nxp b/drivers/bluetooth/hci/Kconfig.nxp deleted file mode 100644 index a5eb8648c8a..00000000000 --- a/drivers/bluetooth/hci/Kconfig.nxp +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright 2023 NXP -# -# SPDX-License-Identifier: Apache-2.0 -# - -config HCI_NXP_ENABLE_AUTO_SLEEP - bool "BLE Controller auto sleep mode" - help - If enabled, the Controller auto sleep mode will be configured and enabled during HCI init. - Auto sleep mode means the Controller will handle its low power state automatically. - Enabling this feature will allow to save power at the cost of some latency when sending a HCI - message to the Controller as the Host will need to wake it up. - -config HCI_NXP_SET_CAL_DATA - bool "BLE Controller calibration data" - help - If enabled, the Host will send calibration data to the BLE Controller during HCI init. - -config HCI_NXP_SET_CAL_DATA_ANNEX100 - bool "BLE Controller calibration data annex 100" - help - If enabled, the Host will send calibration data annex 100 to the BLE Controller during HCI - init. diff --git a/drivers/bluetooth/hci/hci_nxp.c b/drivers/bluetooth/hci/hci_nxp.c deleted file mode 100644 index 78016a794b5..00000000000 --- a/drivers/bluetooth/hci/hci_nxp.c +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Copyright 2023 NXP - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* -------------------------------------------------------------------------- */ -/* Includes */ -/* -------------------------------------------------------------------------- */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* -------------------------------------------------------------------------- */ -/* Definitions */ -/* -------------------------------------------------------------------------- */ - -#define DT_DRV_COMPAT nxp_hci_ble - -#define LOG_LEVEL CONFIG_BT_HCI_DRIVER_LOG_LEVEL -LOG_MODULE_REGISTER(bt_driver); - -#define HCI_IRQ_N DT_INST_IRQ_BY_NAME(0, hci_int, irq) -#define HCI_IRQ_P DT_INST_IRQ_BY_NAME(0, hci_int, priority) -#define HCI_WAKEUP_IRQ_N DT_INST_IRQ_BY_NAME(0, wakeup_int, irq) -#define HCI_WAKEUP_IRQ_P DT_INST_IRQ_BY_NAME(0, wakeup_int, priority) - -/* Vendor specific commands */ -#define HCI_CMD_STORE_BT_CAL_DATA_OCF 0x61U -#define HCI_CMD_STORE_BT_CAL_DATA_PARAM_LENGTH 32U -#define HCI_CMD_STORE_BT_CAL_DATA_ANNEX100_OCF 0xFFU -#define HCI_CMD_STORE_BT_CAL_DATA_PARAM_ANNEX100_LENGTH 16U -#define HCI_CMD_SET_BT_SLEEP_MODE_OCF 0x23U -#define HCI_CMD_SET_BT_SLEEP_MODE_PARAM_LENGTH 3U -#define HCI_CMD_BT_HOST_SLEEP_CONFIG_OCF 0x59U -#define HCI_CMD_BT_HOST_SLEEP_CONFIG_PARAM_LENGTH 2U - -/* -------------------------------------------------------------------------- */ -/* Public prototypes */ -/* -------------------------------------------------------------------------- */ - -extern int32_t ble_hci_handler(void); -extern int32_t ble_wakeup_done_handler(void); - -/* -------------------------------------------------------------------------- */ -/* Private functions */ -/* -------------------------------------------------------------------------- */ - -#if CONFIG_HCI_NXP_ENABLE_AUTO_SLEEP || CONFIG_HCI_NXP_SET_CAL_DATA -static int nxp_bt_send_vs_command(uint16_t opcode, const uint8_t *params, uint8_t params_len) -{ -#if CONFIG_BT_HCI_HOST - struct net_buf *buf; - - /* Allocate buffer for the hci command */ - buf = bt_hci_cmd_create(opcode, params_len); - if (buf == NULL) { - LOG_ERR("Unable to allocate command buffer"); - return -ENOMEM; - } - - /* Add data part of packet */ - net_buf_add_mem(buf, params, params_len); - - /* Send the command */ - return bt_hci_cmd_send_sync(opcode, buf, NULL); -#else - return 0; -#endif -} -#endif /* CONFIG_HCI_NXP_ENABLE_AUTO_SLEEP || CONFIG_HCI_NXP_SET_CAL_DATA */ - -#if CONFIG_HCI_NXP_ENABLE_AUTO_SLEEP -static int nxp_bt_enable_controller_autosleep(void) -{ - uint16_t opcode = BT_OP(BT_OGF_VS, HCI_CMD_SET_BT_SLEEP_MODE_OCF); - const uint8_t params[HCI_CMD_SET_BT_SLEEP_MODE_PARAM_LENGTH] = { - 0x02U, /* Auto sleep enable */ - 0x00U, /* Idle timeout LSB */ - 0x00U /* Idle timeout MSB */ - }; - - /* Send the command */ - return nxp_bt_send_vs_command(opcode, params, HCI_CMD_SET_BT_SLEEP_MODE_PARAM_LENGTH); -} - -static int nxp_bt_set_host_sleep_config(void) -{ - uint16_t opcode = BT_OP(BT_OGF_VS, HCI_CMD_BT_HOST_SLEEP_CONFIG_OCF); - const uint8_t params[HCI_CMD_BT_HOST_SLEEP_CONFIG_PARAM_LENGTH] = { - 0xFFU, /* BT_HIU_WAKEUP_INBAND */ - 0xFFU, /* BT_HIU_WAKE_GAP_WAIT_FOR_IRQ */ - }; - - /* Send the command */ - return nxp_bt_send_vs_command(opcode, params, HCI_CMD_BT_HOST_SLEEP_CONFIG_PARAM_LENGTH); -} -#endif /* CONFIG_HCI_NXP_ENABLE_AUTO_SLEEP */ - -#if CONFIG_HCI_NXP_SET_CAL_DATA -static int bt_nxp_set_calibration_data(void) -{ - uint16_t opcode = BT_OP(BT_OGF_VS, HCI_CMD_STORE_BT_CAL_DATA_OCF); - extern const uint8_t hci_cal_data_params[HCI_CMD_STORE_BT_CAL_DATA_PARAM_LENGTH]; - - /* Send the command */ - return nxp_bt_send_vs_command(opcode, hci_cal_data_params, - HCI_CMD_STORE_BT_CAL_DATA_PARAM_LENGTH); -} - -#if CONFIG_HCI_NXP_SET_CAL_DATA_ANNEX100 -static int bt_nxp_set_calibration_data_annex100(void) -{ - uint16_t opcode = BT_OP(BT_OGF_VS, HCI_CMD_STORE_BT_CAL_DATA_ANNEX100_OCF); - - extern const uint8_t - hci_cal_data_annex100_params[HCI_CMD_STORE_BT_CAL_DATA_PARAM_ANNEX100_LENGTH]; - - /* Send the command */ - return nxp_bt_send_vs_command(opcode, hci_cal_data_annex100_params, - HCI_CMD_STORE_BT_CAL_DATA_PARAM_ANNEX100_LENGTH); -} -#endif /* CONFIG_HCI_NXP_SET_CAL_DATA_ANNEX100 */ - -#endif /* CONFIG_HCI_NXP_SET_CAL_DATA */ - -static bool is_hci_event_discardable(const uint8_t *evt_data) -{ - bool ret = false; - uint8_t evt_type = evt_data[0]; - - switch (evt_type) { - case BT_HCI_EVT_LE_META_EVENT: { - uint8_t subevt_type = evt_data[sizeof(struct bt_hci_evt_hdr)]; - - switch (subevt_type) { - case BT_HCI_EVT_LE_ADVERTISING_REPORT: - case BT_HCI_EVT_LE_EXT_ADVERTISING_REPORT: - ret = true; - break; - default: - break; - } - } break; - - default: - break; - } - - return ret; -} - -static struct net_buf *bt_evt_recv(uint8_t *data, size_t len) -{ - struct net_buf *buf; - uint8_t payload_len; - uint8_t evt_hdr; - bool discardable_evt; - size_t space_in_buffer; - - payload_len = data[1]; - evt_hdr = data[0]; - discardable_evt = false; - - /* Data Check */ - if (len < BT_HCI_EVT_HDR_SIZE) { - LOG_ERR("Event header is missing"); - return NULL; - } - if ((len - BT_HCI_EVT_HDR_SIZE) != payload_len) { - LOG_ERR("Event payload length is incorrect"); - return NULL; - } - - discardable_evt = is_hci_event_discardable(data); - - /* Allocate a buffer for the HCI Event */ - buf = bt_buf_get_evt(evt_hdr, discardable_evt, (discardable_evt ? K_NO_WAIT : K_FOREVER)); - - if (buf) { - space_in_buffer = net_buf_tailroom(buf); - if (len > space_in_buffer) { - LOG_ERR("Buffer size error,INFO : evt_hdr=%d, data_len=%zu, buf_size=%zu", - evt_hdr, len, space_in_buffer); - net_buf_unref(buf); - return NULL; - } - /* Copy the data to the buffer */ - net_buf_add_mem(buf, data, len); - } else { - if (discardable_evt) { - LOG_DBG("Discardable buffer pool full, ignoring event"); - } else { - LOG_ERR("No available event buffers!"); - } - return NULL; - } - - return buf; -} - -static struct net_buf *bt_acl_recv(uint8_t *data, size_t len) -{ - struct net_buf *buf; - uint16_t payload_len; - - /* Data Check */ - if (len < BT_HCI_ACL_HDR_SIZE) { - LOG_ERR("ACL header is missing"); - return NULL; - } - memcpy((void *)&payload_len, (void *)&data[2], 2); - if ((len - BT_HCI_ACL_HDR_SIZE) != payload_len) { - LOG_ERR("ACL payload length is incorrect"); - return NULL; - } - /* Allocate a buffer for the received data */ - buf = bt_buf_get_rx(BT_BUF_ACL_IN, K_NO_WAIT); - - if (buf) { - if (len > net_buf_tailroom(buf)) { - LOG_ERR("Buffer doesn't have enough space to store the data"); - net_buf_unref(buf); - return NULL; - } - /* Copy the data to the buffer */ - net_buf_add_mem(buf, data, len); - } else { - LOG_ERR("ACL buffer is empty"); - return NULL; - } - - return buf; -} - -static void hci_rx_cb(uint8_t packetType, uint8_t *data, uint16_t len) -{ - struct net_buf *buf; - - switch (packetType) { - case BT_HCI_H4_EVT: - /* create a buffer and fill it out with event data */ - buf = bt_evt_recv(data, len); - break; - case BT_HCI_H4_ACL: - /* create a buffer and fill it out with ACL data */ - buf = bt_acl_recv(data, len); - break; - default: - buf = NULL; - LOG_ERR("Unknown HCI type"); - } - - if (buf) { - /* Provide the buffer to the host */ - bt_recv(buf); - } -} - -static int bt_nxp_send(struct net_buf *buf) -{ - uint8_t packetType; - - switch (bt_buf_get_type(buf)) { - case BT_BUF_CMD: - packetType = BT_HCI_H4_CMD; - break; - case BT_BUF_ACL_OUT: - packetType = BT_HCI_H4_ACL; - break; - default: - LOG_ERR("Not supported type"); - return -1; - } - - net_buf_push_u8(buf, packetType); - PLATFORM_SendHciMessage(buf->data, buf->len); - - net_buf_unref(buf); - - return 0; -} - -static int bt_nxp_open(void) -{ - int ret = 0; - - do { - ret = PLATFORM_InitBle(); - if (ret < 0) { - LOG_ERR("Failed to initialize BLE controller"); - break; - } - - ret = PLATFORM_SetHciRxCallback(hci_rx_cb); - if (ret < 0) { - LOG_ERR("BLE HCI RX callback registration failed"); - break; - } - - ret = PLATFORM_StartHci(); - if (ret < 0) { - LOG_ERR("HCI open failed"); - break; - } - -#if CONFIG_HCI_NXP_SET_CAL_DATA - ret = bt_nxp_set_calibration_data(); - if (ret < 0) { - LOG_ERR("Failed to set calibration data"); - break; - } -#if CONFIG_HCI_NXP_SET_CAL_DATA_ANNEX100 - /* After send annex55 to CPU2, CPU2 need reset, - * a delay of at least 20ms is required to continue sending annex100 - */ - k_sleep(Z_TIMEOUT_MS(20)); - - ret = bt_nxp_set_calibration_data_annex100(); - if (ret < 0) { - LOG_ERR("Failed to set calibration data"); - break; - } -#endif /* CONFIG_HCI_NXP_SET_CAL_DATA_ANNEX100 */ -#endif /* CONFIG_HCI_NXP_SET_CAL_DATA */ - -#if CONFIG_HCI_NXP_ENABLE_AUTO_SLEEP - ret = nxp_bt_set_host_sleep_config(); - if (ret < 0) { - LOG_ERR("Failed to set host sleep config"); - break; - } - - ret = nxp_bt_enable_controller_autosleep(); - if (ret < 0) { - LOG_ERR("Failed to configure controller autosleep"); - break; - } -#endif - } while (false); - - return ret; -} - -static int bt_nxp_close(void) -{ - int ret = 0; - /* Reset the Controller */ -#if CONFIG_BT_HCI_HOST - ret = bt_hci_cmd_send_sync(BT_HCI_OP_RESET, NULL, NULL); - if (ret) { - LOG_ERR("Failed to reset BLE controller"); - } - k_sleep(K_SECONDS(1)); - - ret = PLATFORM_TerminateBle(); - if (ret < 0) { - LOG_ERR("Failed to shutdown BLE controller"); - } -#endif - return ret; -} - -static const struct bt_hci_driver drv = { - .name = "BT NXP", - .open = bt_nxp_open, - .close = bt_nxp_close, - .send = bt_nxp_send, - .bus = BT_HCI_DRIVER_BUS_IPM, -}; - -static int bt_nxp_init(void) -{ - int status; - int ret = 0; - - /* HCI Interrupt */ - IRQ_CONNECT(HCI_IRQ_N, HCI_IRQ_P, ble_hci_handler, 0, 0); - irq_enable(HCI_IRQ_N); - - /* Wake up done interrupt */ - IRQ_CONNECT(HCI_WAKEUP_IRQ_N, HCI_WAKEUP_IRQ_P, ble_wakeup_done_handler, 0, 0); - irq_enable(HCI_WAKEUP_IRQ_N); - -#if (DT_INST_PROP(0, wakeup_source)) && CONFIG_PM - EnableDeepSleepIRQ(HCI_IRQ_N); -#endif - - do { - status = PLATFORM_InitBle(); - if (status < 0) { - LOG_ERR("BLE Controller initialization failed"); - ret = status; - break; - } - - status = bt_hci_driver_register(&drv); - if (status < 0) { - LOG_ERR("HCI driver registration failed"); - ret = status; - break; - } - } while (0); - - return ret; -} - -SYS_INIT(bt_nxp_init, POST_KERNEL, CONFIG_BT_HCI_INIT_PRIORITY); diff --git a/west.yml b/west.yml index 90283c1b7ab..e34274c4747 100644 --- a/west.yml +++ b/west.yml @@ -193,7 +193,7 @@ manifest: groups: - hal - name: hal_nxp - revision: 5e84f1d2173e3c5057725d76f9dad6bfabad0b5f + revision: 57d844b03ea545aa702ae99d9777481709ba8aa4 path: modules/hal/nxp groups: - hal From c717e916e8bf343e82f5bc436e9ebcad1d04b2ca Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 242/825] Revert "[nrf fromtree] Bluetooth: samples: Fix PAwR samples to match board capabilities" This reverts commit fbb3a05fe87ea276911cbcc338fcc9a73a1a1a34. --- samples/bluetooth/periodic_adv_conn/sample.yaml | 6 +++++- samples/bluetooth/periodic_adv_rsp/sample.yaml | 6 +++++- samples/bluetooth/periodic_sync_conn/sample.yaml | 6 +++++- samples/bluetooth/periodic_sync_rsp/sample.yaml | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/samples/bluetooth/periodic_adv_conn/sample.yaml b/samples/bluetooth/periodic_adv_conn/sample.yaml index cc3ea8e24e9..cfc9d0522f4 100644 --- a/samples/bluetooth/periodic_adv_conn/sample.yaml +++ b/samples/bluetooth/periodic_adv_conn/sample.yaml @@ -6,6 +6,10 @@ tests: platform_allow: - qemu_cortex_m3 - qemu_x86 + - nrf52840dk/nrf52840 tags: bluetooth integration_platforms: - - qemu_cortex_m3 + - nrf52840dk/nrf52840 + extra_configs: + - CONFIG_BT_CTLR=n + - CONFIG_BT_NO_DRIVER=y diff --git a/samples/bluetooth/periodic_adv_rsp/sample.yaml b/samples/bluetooth/periodic_adv_rsp/sample.yaml index fd22311303b..dcb37b9fe4a 100644 --- a/samples/bluetooth/periodic_adv_rsp/sample.yaml +++ b/samples/bluetooth/periodic_adv_rsp/sample.yaml @@ -6,6 +6,10 @@ tests: platform_allow: - qemu_cortex_m3 - qemu_x86 + - nrf52840dk/nrf52840 tags: bluetooth integration_platforms: - - qemu_cortex_m3 + - nrf52840dk/nrf52840 + extra_configs: + - CONFIG_BT_CTLR=n + - CONFIG_BT_NO_DRIVER=y diff --git a/samples/bluetooth/periodic_sync_conn/sample.yaml b/samples/bluetooth/periodic_sync_conn/sample.yaml index a13d15c8ff0..e7aca788eea 100644 --- a/samples/bluetooth/periodic_sync_conn/sample.yaml +++ b/samples/bluetooth/periodic_sync_conn/sample.yaml @@ -6,6 +6,10 @@ tests: platform_allow: - qemu_cortex_m3 - qemu_x86 + - nrf52840dk/nrf52840 tags: bluetooth integration_platforms: - - qemu_cortex_m3 + - nrf52840dk/nrf52840 + extra_configs: + - CONFIG_BT_CTLR=n + - CONFIG_BT_NO_DRIVER=y diff --git a/samples/bluetooth/periodic_sync_rsp/sample.yaml b/samples/bluetooth/periodic_sync_rsp/sample.yaml index e31e7f61bad..c0f073b19e0 100644 --- a/samples/bluetooth/periodic_sync_rsp/sample.yaml +++ b/samples/bluetooth/periodic_sync_rsp/sample.yaml @@ -6,6 +6,10 @@ tests: platform_allow: - qemu_cortex_m3 - qemu_x86 + - nrf52840dk/nrf52840 tags: bluetooth integration_platforms: - - qemu_cortex_m3 + - nrf52840dk/nrf52840 + extra_configs: + - CONFIG_BT_CTLR=n + - CONFIG_BT_NO_DRIVER=y From 6cdb8ffcad3ee7aa55b76ac97a711f67d111aeed Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:02 +0200 Subject: [PATCH 243/825] Revert "[nrf fromtree] qemu: Use BT_UART instead of BT_NO_DRIVER to enable serial port" This reverts commit a7ec38f5f31147322a2f209aa289e780582c3036. --- cmake/emu/qemu.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/emu/qemu.cmake b/cmake/emu/qemu.cmake index 0fd445f3c59..6103fc1cefc 100644 --- a/cmake/emu/qemu.cmake +++ b/cmake/emu/qemu.cmake @@ -100,7 +100,7 @@ endif() # Add a BT serial device when building for bluetooth, unless the # application explicitly opts out with NO_QEMU_SERIAL_BT_SERVER. if(CONFIG_BT) - if(NOT CONFIG_BT_UART) + if(CONFIG_BT_NO_DRIVER) set(NO_QEMU_SERIAL_BT_SERVER 1) endif() if(NOT NO_QEMU_SERIAL_BT_SERVER) From b25ad6e22da24065adec88874cc595d873d0ae57 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 244/825] Revert "[nrf fromtree] Bluetooth: tests: Convert to new HCI driver API" This reverts commit 549e21978ea46efe7275af1e75928392429d21bc. --- tests/bluetooth/addr/prj.conf | 2 +- tests/bluetooth/addr/test.overlay | 5 -- tests/bluetooth/addr/testcase.yaml | 2 - .../dts/bindings/zephyr,bt-hci-test.yaml | 11 ----- tests/bluetooth/bluetooth/prj.conf | 2 +- tests/bluetooth/bluetooth/src/bluetooth.c | 32 ++++++------ tests/bluetooth/bluetooth/test.overlay | 10 ---- tests/bluetooth/bluetooth/testcase.yaml | 2 - tests/bluetooth/bt_crypto/prj.conf | 2 +- tests/bluetooth/bt_crypto/test.overlay | 5 -- tests/bluetooth/bt_crypto/testcase.yaml | 2 - tests/bluetooth/bt_crypto_ccm/prj.conf | 2 +- tests/bluetooth/bt_crypto_ccm/test.overlay | 5 -- tests/bluetooth/bt_crypto_ccm/testcase.yaml | 2 - tests/bluetooth/gatt/prj.conf | 2 +- tests/bluetooth/gatt/test.overlay | 5 -- tests/bluetooth/gatt/testcase.yaml | 2 - .../dts/bindings/zephyr,bt-hci-test.yaml | 13 ----- tests/bluetooth/hci_prop_evt/prj.conf | 2 +- tests/bluetooth/hci_prop_evt/src/main.c | 49 +++++++------------ tests/bluetooth/hci_prop_evt/test.overlay | 10 ---- tests/bluetooth/hci_prop_evt/testcase.yaml | 2 - .../hci_uart_async/boards/native_posix.conf | 3 ++ .../hci_uart_async/boards/native_sim.conf | 3 ++ .../dts/bindings/zephyr,bt-hci-test.yaml | 11 ----- tests/bluetooth/hci_uart_async/prj.conf | 2 + .../hci_uart_async/src/test_hci_uart_async.c | 44 +++++------------ tests/bluetooth/hci_uart_async/test.overlay | 10 ---- tests/bluetooth/hci_uart_async/testcase.yaml | 2 - .../dts/bindings/zephyr,bt-hci-test.yaml | 13 ----- tests/bluetooth/host_long_adv_recv/prj.conf | 2 +- tests/bluetooth/host_long_adv_recv/src/main.c | 46 ++++++----------- .../bluetooth/host_long_adv_recv/test.overlay | 10 ---- .../host_long_adv_recv/testcase.yaml | 2 - tests/bluetooth/l2cap/prj.conf | 2 +- tests/bluetooth/l2cap/test.overlay | 5 -- tests/bluetooth/l2cap/testcase.yaml | 2 - tests/bluetooth/mesh/blob_io_flash/prj.conf | 1 + .../bluetooth/mesh/blob_io_flash/test.overlay | 9 ---- .../mesh/blob_io_flash/testcase.yaml | 2 - tests/bluetooth/uuid/prj.conf | 2 +- tests/bluetooth/uuid/test.overlay | 5 -- tests/bluetooth/uuid/testcase.yaml | 2 - 43 files changed, 76 insertions(+), 271 deletions(-) delete mode 100644 tests/bluetooth/addr/test.overlay delete mode 100644 tests/bluetooth/bluetooth/dts/bindings/zephyr,bt-hci-test.yaml delete mode 100644 tests/bluetooth/bluetooth/test.overlay delete mode 100644 tests/bluetooth/bt_crypto/test.overlay delete mode 100644 tests/bluetooth/bt_crypto_ccm/test.overlay delete mode 100644 tests/bluetooth/gatt/test.overlay delete mode 100644 tests/bluetooth/hci_prop_evt/dts/bindings/zephyr,bt-hci-test.yaml delete mode 100644 tests/bluetooth/hci_prop_evt/test.overlay create mode 100644 tests/bluetooth/hci_uart_async/boards/native_posix.conf create mode 100644 tests/bluetooth/hci_uart_async/boards/native_sim.conf delete mode 100644 tests/bluetooth/hci_uart_async/dts/bindings/zephyr,bt-hci-test.yaml delete mode 100644 tests/bluetooth/hci_uart_async/test.overlay delete mode 100644 tests/bluetooth/host_long_adv_recv/dts/bindings/zephyr,bt-hci-test.yaml delete mode 100644 tests/bluetooth/host_long_adv_recv/test.overlay delete mode 100644 tests/bluetooth/l2cap/test.overlay delete mode 100644 tests/bluetooth/mesh/blob_io_flash/test.overlay delete mode 100644 tests/bluetooth/uuid/test.overlay diff --git a/tests/bluetooth/addr/prj.conf b/tests/bluetooth/addr/prj.conf index 1f86a43c208..fec5098eecf 100644 --- a/tests/bluetooth/addr/prj.conf +++ b/tests/bluetooth/addr/prj.conf @@ -3,4 +3,4 @@ CONFIG_ZTEST=y CONFIG_BT=y CONFIG_BT_CTLR=n -CONFIG_BT_H4=n +CONFIG_BT_NO_DRIVER=y diff --git a/tests/bluetooth/addr/test.overlay b/tests/bluetooth/addr/test.overlay deleted file mode 100644 index badbe2f392a..00000000000 --- a/tests/bluetooth/addr/test.overlay +++ /dev/null @@ -1,5 +0,0 @@ -/ { - chosen { - /delete-property/ zephyr,bt-hci; - }; -}; diff --git a/tests/bluetooth/addr/testcase.yaml b/tests/bluetooth/addr/testcase.yaml index 54cfe092aee..c4746b2da29 100644 --- a/tests/bluetooth/addr/testcase.yaml +++ b/tests/bluetooth/addr/testcase.yaml @@ -1,7 +1,5 @@ tests: bluetooth.addr: - extra_args: - - EXTRA_DTC_OVERLAY_FILE="test.overlay" platform_allow: - native_posix - native_posix/native/64 diff --git a/tests/bluetooth/bluetooth/dts/bindings/zephyr,bt-hci-test.yaml b/tests/bluetooth/bluetooth/dts/bindings/zephyr,bt-hci-test.yaml deleted file mode 100644 index cd5c0ecd760..00000000000 --- a/tests/bluetooth/bluetooth/dts/bindings/zephyr,bt-hci-test.yaml +++ /dev/null @@ -1,11 +0,0 @@ -description: Bluetooth HCI for test purposes - -compatible: "zephyr,bt-hci-test" - -include: bt-hci.yaml - -properties: - bt-hci-name: - default: "test" - bt-hci-bus: - default: "BT_HCI_BUS_VIRTUAL" diff --git a/tests/bluetooth/bluetooth/prj.conf b/tests/bluetooth/bluetooth/prj.conf index 43ee74e49e6..ee911c43132 100644 --- a/tests/bluetooth/bluetooth/prj.conf +++ b/tests/bluetooth/bluetooth/prj.conf @@ -1,6 +1,6 @@ CONFIG_BT=y CONFIG_BT_CTLR=n -CONFIG_BT_H4=n +CONFIG_BT_NO_DRIVER=y CONFIG_LOG=y CONFIG_UART_INTERRUPT_DRIVEN=n CONFIG_ZTEST=y diff --git a/tests/bluetooth/bluetooth/src/bluetooth.c b/tests/bluetooth/bluetooth/src/bluetooth.c index 92889f9b598..4b02efdcdc9 100644 --- a/tests/bluetooth/bluetooth/src/bluetooth.c +++ b/tests/bluetooth/bluetooth/src/bluetooth.c @@ -13,16 +13,11 @@ #include #include -#include - -#define DT_DRV_COMPAT zephyr_bt_hci_test - -struct driver_data { -}; +#include #define EXPECTED_ERROR -ENOSYS -static int driver_open(const struct device *dev, bt_hci_recv_t recv) +static int driver_open(void) { TC_PRINT("driver: %s\n", __func__); @@ -30,28 +25,29 @@ static int driver_open(const struct device *dev, bt_hci_recv_t recv) return EXPECTED_ERROR; } -static int driver_send(const struct device *dev, struct net_buf *buf) +static int driver_send(struct net_buf *buf) { return 0; } -static const struct bt_hci_driver_api driver_api = { - .open = driver_open, - .send = driver_send, +static const struct bt_hci_driver drv = { + .name = "test", + .bus = BT_HCI_DRIVER_BUS_VIRTUAL, + .open = driver_open, + .send = driver_send, }; -#define TEST_DEVICE_INIT(inst) \ - static struct driver_data driver_data_##inst = { \ - }; \ - DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &driver_data_##inst, NULL, \ - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &driver_api) - -DT_INST_FOREACH_STATUS_OKAY(TEST_DEVICE_INIT) +static void driver_init(void) +{ + bt_hci_driver_register(&drv); +} ZTEST_SUITE(test_bluetooth, NULL, NULL, NULL, NULL, NULL); ZTEST(test_bluetooth, test_bluetooth_entry) { + driver_init(); + zassert_true((bt_enable(NULL) == EXPECTED_ERROR), "bt_enable failed"); } diff --git a/tests/bluetooth/bluetooth/test.overlay b/tests/bluetooth/bluetooth/test.overlay deleted file mode 100644 index c0f0b1c5b29..00000000000 --- a/tests/bluetooth/bluetooth/test.overlay +++ /dev/null @@ -1,10 +0,0 @@ -/ { - chosen { - zephyr,bt-hci = &bt_hci_test; - }; - - bt_hci_test: bt_hci_test { - compatible = "zephyr,bt-hci-test"; - status = "okay"; - }; -}; diff --git a/tests/bluetooth/bluetooth/testcase.yaml b/tests/bluetooth/bluetooth/testcase.yaml index 3c54ea6f7bf..a7dccced9ea 100644 --- a/tests/bluetooth/bluetooth/testcase.yaml +++ b/tests/bluetooth/bluetooth/testcase.yaml @@ -1,7 +1,5 @@ tests: bluetooth.general: - extra_args: - - EXTRA_DTC_OVERLAY_FILE="test.overlay" platform_allow: - qemu_x86 - qemu_cortex_m3 diff --git a/tests/bluetooth/bt_crypto/prj.conf b/tests/bluetooth/bt_crypto/prj.conf index 1f86a43c208..fec5098eecf 100644 --- a/tests/bluetooth/bt_crypto/prj.conf +++ b/tests/bluetooth/bt_crypto/prj.conf @@ -3,4 +3,4 @@ CONFIG_ZTEST=y CONFIG_BT=y CONFIG_BT_CTLR=n -CONFIG_BT_H4=n +CONFIG_BT_NO_DRIVER=y diff --git a/tests/bluetooth/bt_crypto/test.overlay b/tests/bluetooth/bt_crypto/test.overlay deleted file mode 100644 index badbe2f392a..00000000000 --- a/tests/bluetooth/bt_crypto/test.overlay +++ /dev/null @@ -1,5 +0,0 @@ -/ { - chosen { - /delete-property/ zephyr,bt-hci; - }; -}; diff --git a/tests/bluetooth/bt_crypto/testcase.yaml b/tests/bluetooth/bt_crypto/testcase.yaml index 430d763d0cb..e486846175e 100644 --- a/tests/bluetooth/bt_crypto/testcase.yaml +++ b/tests/bluetooth/bt_crypto/testcase.yaml @@ -1,7 +1,5 @@ tests: bluetooth.bt_crypto: - extra_args: - - EXTRA_DTC_OVERLAY_FILE="test.overlay" platform_allow: - native_posix - native_posix/native/64 diff --git a/tests/bluetooth/bt_crypto_ccm/prj.conf b/tests/bluetooth/bt_crypto_ccm/prj.conf index 4ab1d5395f7..68662d4a0c5 100644 --- a/tests/bluetooth/bt_crypto_ccm/prj.conf +++ b/tests/bluetooth/bt_crypto_ccm/prj.conf @@ -3,6 +3,6 @@ CONFIG_ZTEST=y CONFIG_BT=y CONFIG_BT_CTLR=n -CONFIG_BT_H4=n +CONFIG_BT_NO_DRIVER=y CONFIG_LOG=y diff --git a/tests/bluetooth/bt_crypto_ccm/test.overlay b/tests/bluetooth/bt_crypto_ccm/test.overlay deleted file mode 100644 index badbe2f392a..00000000000 --- a/tests/bluetooth/bt_crypto_ccm/test.overlay +++ /dev/null @@ -1,5 +0,0 @@ -/ { - chosen { - /delete-property/ zephyr,bt-hci; - }; -}; diff --git a/tests/bluetooth/bt_crypto_ccm/testcase.yaml b/tests/bluetooth/bt_crypto_ccm/testcase.yaml index 77dd0dcbb8e..43c35f6a757 100644 --- a/tests/bluetooth/bt_crypto_ccm/testcase.yaml +++ b/tests/bluetooth/bt_crypto_ccm/testcase.yaml @@ -1,7 +1,5 @@ tests: bluetooth.bt_crypto_ccm: - extra_args: - - EXTRA_DTC_OVERLAY_FILE="test.overlay" platform_allow: - native_posix - native_posix/native/64 diff --git a/tests/bluetooth/gatt/prj.conf b/tests/bluetooth/gatt/prj.conf index f705142d552..c59f96a921e 100644 --- a/tests/bluetooth/gatt/prj.conf +++ b/tests/bluetooth/gatt/prj.conf @@ -3,7 +3,7 @@ CONFIG_ZTEST=y CONFIG_BT=y CONFIG_BT_CTLR=n -CONFIG_BT_H4=n +CONFIG_BT_NO_DRIVER=y CONFIG_LOG=y CONFIG_BT_PERIPHERAL=y diff --git a/tests/bluetooth/gatt/test.overlay b/tests/bluetooth/gatt/test.overlay deleted file mode 100644 index badbe2f392a..00000000000 --- a/tests/bluetooth/gatt/test.overlay +++ /dev/null @@ -1,5 +0,0 @@ -/ { - chosen { - /delete-property/ zephyr,bt-hci; - }; -}; diff --git a/tests/bluetooth/gatt/testcase.yaml b/tests/bluetooth/gatt/testcase.yaml index 135f6d823ed..5e1fa97a4b9 100644 --- a/tests/bluetooth/gatt/testcase.yaml +++ b/tests/bluetooth/gatt/testcase.yaml @@ -1,7 +1,5 @@ tests: bluetooth.gatt: - extra_args: - - EXTRA_DTC_OVERLAY_FILE="test.overlay" platform_allow: - native_posix - native_posix/native/64 diff --git a/tests/bluetooth/hci_prop_evt/dts/bindings/zephyr,bt-hci-test.yaml b/tests/bluetooth/hci_prop_evt/dts/bindings/zephyr,bt-hci-test.yaml deleted file mode 100644 index 7d8adacc908..00000000000 --- a/tests/bluetooth/hci_prop_evt/dts/bindings/zephyr,bt-hci-test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -description: Bluetooth HCI for test purposes - -compatible: "zephyr,bt-hci-test" - -include: bt-hci.yaml - -properties: - bt-hci-name: - default: "test" - bt-hci-bus: - default: "BT_HCI_BUS_VIRTUAL" - bt-hci-quirks: - default: ["BT_HCI_QUIRK_NO_RESET"] diff --git a/tests/bluetooth/hci_prop_evt/prj.conf b/tests/bluetooth/hci_prop_evt/prj.conf index 5d87f13964c..56460e4ab1a 100644 --- a/tests/bluetooth/hci_prop_evt/prj.conf +++ b/tests/bluetooth/hci_prop_evt/prj.conf @@ -3,7 +3,7 @@ CONFIG_ZTEST=y CONFIG_BT=y CONFIG_BT_CTLR=n -CONFIG_BT_H4=n +CONFIG_BT_NO_DRIVER=y CONFIG_BT_HCI_VS_EVT_USER=y diff --git a/tests/bluetooth/hci_prop_evt/src/main.c b/tests/bluetooth/hci_prop_evt/src/main.c index ea433b62df4..cf46a2bad65 100644 --- a/tests/bluetooth/hci_prop_evt/src/main.c +++ b/tests/bluetooth/hci_prop_evt/src/main.c @@ -15,15 +15,9 @@ #include #include #include -#include +#include #include -#define DT_DRV_COMPAT zephyr_bt_hci_test - -struct driver_data { - bt_hci_recv_t recv; -}; - /* HCI Proprietary vendor event */ const uint8_t hci_prop_evt_prefix[2] = { 0xAB, 0xBA }; @@ -90,12 +84,10 @@ static int cmd_handle_helper(uint16_t opcode, struct net_buf *cmd, } /* Lookup the command opcode and invoke handler. */ -static int cmd_handle(const struct device *dev, - struct net_buf *cmd, +static int cmd_handle(struct net_buf *cmd, const struct cmd_handler *handlers, size_t num_handlers) { - struct driver_data *drv = dev->data; struct net_buf *evt = NULL; struct bt_hci_evt_cc_status *ccst; struct bt_hci_cmd_hdr *chdr; @@ -113,7 +105,7 @@ static int cmd_handle(const struct device *dev, } if (evt) { - drv->recv(dev, evt); + bt_recv(evt); } return err; @@ -215,19 +207,15 @@ static const struct cmd_handler cmds[] = { }; /* HCI driver open. */ -static int driver_open(const struct device *dev, bt_hci_recv_t recv) +static int driver_open(void) { - struct driver_data *drv = dev->data; - - drv->recv = recv; - return 0; } /* HCI driver send. */ -static int driver_send(const struct device *dev, struct net_buf *buf) +static int driver_send(struct net_buf *buf) { - zassert_true(cmd_handle(dev, buf, cmds, ARRAY_SIZE(cmds)) == 0, + zassert_true(cmd_handle(buf, cmds, ARRAY_SIZE(cmds)) == 0, "Unknown HCI command"); net_buf_unref(buf); @@ -235,19 +223,15 @@ static int driver_send(const struct device *dev, struct net_buf *buf) return 0; } -static const struct bt_hci_driver_api driver_api = { - .open = driver_open, - .send = driver_send, +/* HCI driver structure. */ +static const struct bt_hci_driver drv = { + .name = "test", + .bus = BT_HCI_DRIVER_BUS_VIRTUAL, + .open = driver_open, + .send = driver_send, + .quirks = BT_QUIRK_NO_RESET, }; -#define TEST_DEVICE_INIT(inst) \ - static struct driver_data driver_data_##inst = { \ - }; \ - DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &driver_data_##inst, NULL, \ - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &driver_api) - -DT_INST_FOREACH_STATUS_OKAY(TEST_DEVICE_INIT) - struct bt_recv_job_data { struct k_work work; /* Work item */ struct k_sem *sync; /* Semaphore to synchronize with */ @@ -259,14 +243,12 @@ struct bt_recv_job_data { /* Work item handler for bt_recv() jobs. */ static void bt_recv_job_cb(struct k_work *item) { - const struct device *dev = DEVICE_DT_GET(DT_DRV_INST(0)); - struct driver_data *drv = dev->data; struct bt_recv_job_data *data = CONTAINER_OF(item, struct bt_recv_job_data, work); struct k_sem *sync = job(data->buf)->sync; /* Send net buffer to host */ - drv->recv(dev, data->buf); + bt_recv(data->buf); data->buf = NULL; /* Wake up bt_recv_job_submit */ @@ -368,6 +350,9 @@ ZTEST_SUITE(test_hci_prop_evt, NULL, NULL, NULL, NULL, NULL); /* Test. */ ZTEST(test_hci_prop_evt, test_hci_prop_evt_entry) { + /* Register the test HCI driver */ + bt_hci_driver_register(&drv); + /* Go! Wait until Bluetooth initialization is done */ zassert_true((bt_enable(NULL) == 0), "bt_enable failed"); diff --git a/tests/bluetooth/hci_prop_evt/test.overlay b/tests/bluetooth/hci_prop_evt/test.overlay deleted file mode 100644 index c0f0b1c5b29..00000000000 --- a/tests/bluetooth/hci_prop_evt/test.overlay +++ /dev/null @@ -1,10 +0,0 @@ -/ { - chosen { - zephyr,bt-hci = &bt_hci_test; - }; - - bt_hci_test: bt_hci_test { - compatible = "zephyr,bt-hci-test"; - status = "okay"; - }; -}; diff --git a/tests/bluetooth/hci_prop_evt/testcase.yaml b/tests/bluetooth/hci_prop_evt/testcase.yaml index e1a41372ada..dde90adf9bc 100644 --- a/tests/bluetooth/hci_prop_evt/testcase.yaml +++ b/tests/bluetooth/hci_prop_evt/testcase.yaml @@ -1,7 +1,5 @@ tests: bluetooth.hci_prop_evt: - extra_args: - - EXTRA_DTC_OVERLAY_FILE="test.overlay" platform_allow: - qemu_x86 - qemu_cortex_m3 diff --git a/tests/bluetooth/hci_uart_async/boards/native_posix.conf b/tests/bluetooth/hci_uart_async/boards/native_posix.conf new file mode 100644 index 00000000000..d9130d07be5 --- /dev/null +++ b/tests/bluetooth/hci_uart_async/boards/native_posix.conf @@ -0,0 +1,3 @@ +# Print logs and test results on stdout as this not the +# default when SERIAL=y. +CONFIG_LOG_BACKEND_NATIVE_POSIX=y diff --git a/tests/bluetooth/hci_uart_async/boards/native_sim.conf b/tests/bluetooth/hci_uart_async/boards/native_sim.conf new file mode 100644 index 00000000000..d9130d07be5 --- /dev/null +++ b/tests/bluetooth/hci_uart_async/boards/native_sim.conf @@ -0,0 +1,3 @@ +# Print logs and test results on stdout as this not the +# default when SERIAL=y. +CONFIG_LOG_BACKEND_NATIVE_POSIX=y diff --git a/tests/bluetooth/hci_uart_async/dts/bindings/zephyr,bt-hci-test.yaml b/tests/bluetooth/hci_uart_async/dts/bindings/zephyr,bt-hci-test.yaml deleted file mode 100644 index 893e6a78cdc..00000000000 --- a/tests/bluetooth/hci_uart_async/dts/bindings/zephyr,bt-hci-test.yaml +++ /dev/null @@ -1,11 +0,0 @@ -description: Bluetooth HCI for test purposes - -compatible: "zephyr,bt-hci-test" - -include: bt-hci.yaml - -properties: - bt-hci-name: - default: "Mock Controller" - bt-hci-bus: - default: "BT_HCI_BUS_VIRTUAL" diff --git a/tests/bluetooth/hci_uart_async/prj.conf b/tests/bluetooth/hci_uart_async/prj.conf index 5f558afdebf..408e8f611e4 100644 --- a/tests/bluetooth/hci_uart_async/prj.conf +++ b/tests/bluetooth/hci_uart_async/prj.conf @@ -1,3 +1,5 @@ +CONFIG_BT_NO_DRIVER=y + CONFIG_RING_BUFFER=y CONFIG_ASSERT=y diff --git a/tests/bluetooth/hci_uart_async/src/test_hci_uart_async.c b/tests/bluetooth/hci_uart_async/src/test_hci_uart_async.c index 69b35ff7f48..08ea8bc1a79 100644 --- a/tests/bluetooth/hci_uart_async/src/test_hci_uart_async.c +++ b/tests/bluetooth/hci_uart_async/src/test_hci_uart_async.c @@ -14,7 +14,7 @@ #include #include -#include +#include #include LOG_MODULE_REGISTER(test, LOG_LEVEL_DBG); @@ -27,35 +27,22 @@ static const struct device *const zephyr_bt_c2h_uart = DEVICE_DT_GET(DT_CHOSEN(z /* The DUT is Sandwiched between the mock serial interface and a mock * controller. {{{ */ -#define DT_DRV_COMPAT zephyr_bt_hci_test - -struct drv_data { - bt_hci_recv_t recv; -}; - static void serial_vnd_data_callback(const struct device *dev, void *user_data); -static int drv_send(const struct device *dev, struct net_buf *buf); -static int drv_open(const struct device *dev, bt_hci_recv_t recv); - -static const struct bt_hci_driver_api drv_api = { +static int drv_send(struct net_buf *buf); +static int drv_open(void); +static const struct bt_hci_driver drv = { + .name = "Mock Controller", + .bus = BT_HCI_DRIVER_BUS_VIRTUAL, .open = drv_open, .send = drv_send, }; - -static int drv_init(const struct device *dev) +static int sys_init_hci_driver_register(void) { serial_vnd_set_callback(zephyr_bt_c2h_uart, serial_vnd_data_callback, NULL); + bt_hci_driver_register(&drv); return 0; } - -#define TEST_DEVICE_INIT(inst) \ - static struct drv_data drv_data_##inst = { \ - }; \ - DEVICE_DT_INST_DEFINE(inst, drv_init, NULL, &drv_data_##inst, NULL, \ - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &drv_api) - -DT_INST_FOREACH_STATUS_OKAY(TEST_DEVICE_INIT) - +SYS_INIT(sys_init_hci_driver_register, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); /* }}} */ /* Start the DUT "main thread". The settings for this thread are selected as @@ -81,14 +68,9 @@ SYS_INIT(sys_init_spawn_hci_uart, POST_KERNEL, 64); /* Mock controller callbacks. {{{ */ -static int drv_open(const struct device *dev, bt_hci_recv_t recv) +static int drv_open(void) { - struct drv_data *drv = dev->data; - LOG_DBG("drv_open"); - - drv->recv = recv; - return 0; } @@ -100,7 +82,7 @@ static int drv_open(const struct device *dev, bt_hci_recv_t recv) * should use #bt_recv to send c2h packets to the DUT. */ K_FIFO_DEFINE(drv_send_fifo); /* elem T: net_buf */ -static int drv_send(const struct device *dev, struct net_buf *buf) +static int drv_send(struct net_buf *buf) { LOG_DBG("buf %p type %d len %u", buf, bt_buf_get_type(buf), buf->len); LOG_HEXDUMP_DBG(buf->data, buf->len, "buf"); @@ -224,15 +206,13 @@ ZTEST(hci_uart, test_h2c_cmd_flow_control) /* The controller sends a HCI Command Complete response. */ { - const struct device *dev = DEVICE_DT_GET(DT_DRV_INST(0)); - struct drv_data *drv = dev->data; int err; struct net_buf *buf = bt_buf_get_rx(BT_BUF_EVT, K_NO_WAIT); zassert_not_null(buf); net_buf_add_mem(buf, hci_msg_rx_evt_cmd_complete, sizeof(hci_msg_rx_evt_cmd_complete)); - err = drv->recv(dev, buf); + err = bt_recv(buf); zassert_equal(err, 0, "bt_recv failed"); } } diff --git a/tests/bluetooth/hci_uart_async/test.overlay b/tests/bluetooth/hci_uart_async/test.overlay deleted file mode 100644 index c0f0b1c5b29..00000000000 --- a/tests/bluetooth/hci_uart_async/test.overlay +++ /dev/null @@ -1,10 +0,0 @@ -/ { - chosen { - zephyr,bt-hci = &bt_hci_test; - }; - - bt_hci_test: bt_hci_test { - compatible = "zephyr,bt-hci-test"; - status = "okay"; - }; -}; diff --git a/tests/bluetooth/hci_uart_async/testcase.yaml b/tests/bluetooth/hci_uart_async/testcase.yaml index b189149d104..8df5113b354 100644 --- a/tests/bluetooth/hci_uart_async/testcase.yaml +++ b/tests/bluetooth/hci_uart_async/testcase.yaml @@ -1,7 +1,5 @@ tests: bluetooth.hci_uart_async: - extra_args: - - EXTRA_DTC_OVERLAY_FILE="test.overlay" tags: - bluetooth - uart diff --git a/tests/bluetooth/host_long_adv_recv/dts/bindings/zephyr,bt-hci-test.yaml b/tests/bluetooth/host_long_adv_recv/dts/bindings/zephyr,bt-hci-test.yaml deleted file mode 100644 index 7d8adacc908..00000000000 --- a/tests/bluetooth/host_long_adv_recv/dts/bindings/zephyr,bt-hci-test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -description: Bluetooth HCI for test purposes - -compatible: "zephyr,bt-hci-test" - -include: bt-hci.yaml - -properties: - bt-hci-name: - default: "test" - bt-hci-bus: - default: "BT_HCI_BUS_VIRTUAL" - bt-hci-quirks: - default: ["BT_HCI_QUIRK_NO_RESET"] diff --git a/tests/bluetooth/host_long_adv_recv/prj.conf b/tests/bluetooth/host_long_adv_recv/prj.conf index 96c30582c50..ab58ed5327b 100644 --- a/tests/bluetooth/host_long_adv_recv/prj.conf +++ b/tests/bluetooth/host_long_adv_recv/prj.conf @@ -3,10 +3,10 @@ CONFIG_ZTEST=y CONFIG_BT=y CONFIG_BT_CTLR=n -CONFIG_BT_H4=n CONFIG_BT_HCI=n CONFIG_BT_HCI_RAW=n CONFIG_BT_OBSERVER=y +CONFIG_BT_NO_DRIVER=y CONFIG_BT_EXT_ADV=y CONFIG_LOG=y diff --git a/tests/bluetooth/host_long_adv_recv/src/main.c b/tests/bluetooth/host_long_adv_recv/src/main.c index 4fb36499055..ef3862456aa 100644 --- a/tests/bluetooth/host_long_adv_recv/src/main.c +++ b/tests/bluetooth/host_long_adv_recv/src/main.c @@ -16,15 +16,9 @@ #include #include #include -#include +#include #include -#define DT_DRV_COMPAT zephyr_bt_hci_test - -struct driver_data { - bt_hci_recv_t recv; -}; - #define LOG_LEVEL CONFIG_BT_LOG_LEVEL #include LOG_MODULE_REGISTER(host_test_app); @@ -117,10 +111,8 @@ static int cmd_handle_helper(uint16_t opcode, struct net_buf *cmd, struct net_bu } /* Lookup the command opcode and invoke handler. */ -static int cmd_handle(const struct device *dev, struct net_buf *cmd, - const struct cmd_handler *handlers, size_t num_handlers) +static int cmd_handle(struct net_buf *cmd, const struct cmd_handler *handlers, size_t num_handlers) { - struct driver_data *drv = dev->data; struct net_buf *evt = NULL; struct bt_hci_evt_cc_status *ccst; struct bt_hci_cmd_hdr *chdr; @@ -138,7 +130,7 @@ static int cmd_handle(const struct device *dev, struct net_buf *cmd, } if (evt) { - drv->recv(dev, evt); + bt_recv(evt); } return err; @@ -223,39 +215,30 @@ static const struct cmd_handler cmds[] = { }; /* HCI driver open. */ -static int driver_open(const struct device *dev, bt_hci_recv_t recv) +static int driver_open(void) { - struct driver_data *drv = dev->data; - - drv->recv = recv; - return 0; } /* HCI driver send. */ -static int driver_send(const struct device *dev, struct net_buf *buf) +static int driver_send(struct net_buf *buf) { - zassert_true(cmd_handle(dev, buf, cmds, ARRAY_SIZE(cmds)) == 0, "Unknown HCI command"); + zassert_true(cmd_handle(buf, cmds, ARRAY_SIZE(cmds)) == 0, "Unknown HCI command"); net_buf_unref(buf); return 0; } -static const struct bt_hci_driver_api driver_api = { +/* HCI driver structure. */ +static const struct bt_hci_driver drv = { + .name = "test", + .bus = BT_HCI_DRIVER_BUS_VIRTUAL, .open = driver_open, .send = driver_send, + .quirks = 0, }; -#define TEST_DEVICE_INIT(inst) \ - static struct driver_data driver_data_##inst = { \ - }; \ - DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &driver_data_##inst, NULL, \ - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &driver_api) - -DT_INST_FOREACH_STATUS_OKAY(TEST_DEVICE_INIT) - - struct bt_recv_job_data { struct k_work work; /* Work item */ struct k_sem *sync; /* Semaphore to synchronize with */ @@ -267,12 +250,10 @@ struct bt_recv_job_data { /* Work item handler for bt_recv() jobs. */ static void bt_recv_job_cb(struct k_work *item) { - const struct device *dev = DEVICE_DT_GET(DT_DRV_INST(0)); - struct driver_data *drv = dev->data; struct bt_recv_job_data *data = CONTAINER_OF(item, struct bt_recv_job_data, work); /* Send net buffer to host */ - drv->recv(dev, data->buf); + bt_recv(data->buf); /* Wake up bt_recv_job_submit */ k_sem_give(job(data->buf)->sync); @@ -376,6 +357,9 @@ ZTEST(long_adv_rx_tests, test_host_long_adv_recv) { struct test_adv_report expected_reports[2]; + /* Register the test HCI driver */ + bt_hci_driver_register(&drv); + /* Go! Wait until Bluetooth initialization is done */ zassert_true((bt_enable(NULL) == 0), "bt_enable failed"); diff --git a/tests/bluetooth/host_long_adv_recv/test.overlay b/tests/bluetooth/host_long_adv_recv/test.overlay deleted file mode 100644 index c0f0b1c5b29..00000000000 --- a/tests/bluetooth/host_long_adv_recv/test.overlay +++ /dev/null @@ -1,10 +0,0 @@ -/ { - chosen { - zephyr,bt-hci = &bt_hci_test; - }; - - bt_hci_test: bt_hci_test { - compatible = "zephyr,bt-hci-test"; - status = "okay"; - }; -}; diff --git a/tests/bluetooth/host_long_adv_recv/testcase.yaml b/tests/bluetooth/host_long_adv_recv/testcase.yaml index dfe4465a42e..7957d03a796 100644 --- a/tests/bluetooth/host_long_adv_recv/testcase.yaml +++ b/tests/bluetooth/host_long_adv_recv/testcase.yaml @@ -1,7 +1,5 @@ tests: bluetooth.host_long_adv_recv: - extra_args: - - EXTRA_DTC_OVERLAY_FILE="test.overlay" platform_allow: - native_posix - native_posix/native/64 diff --git a/tests/bluetooth/l2cap/prj.conf b/tests/bluetooth/l2cap/prj.conf index ace0bc553f4..69eb3d64ca7 100644 --- a/tests/bluetooth/l2cap/prj.conf +++ b/tests/bluetooth/l2cap/prj.conf @@ -3,7 +3,7 @@ CONFIG_ZTEST=y CONFIG_BT=y CONFIG_BT_CTLR=n -CONFIG_BT_H4=n +CONFIG_BT_NO_DRIVER=y CONFIG_LOG=y CONFIG_BT_PERIPHERAL=y diff --git a/tests/bluetooth/l2cap/test.overlay b/tests/bluetooth/l2cap/test.overlay deleted file mode 100644 index badbe2f392a..00000000000 --- a/tests/bluetooth/l2cap/test.overlay +++ /dev/null @@ -1,5 +0,0 @@ -/ { - chosen { - /delete-property/ zephyr,bt-hci; - }; -}; diff --git a/tests/bluetooth/l2cap/testcase.yaml b/tests/bluetooth/l2cap/testcase.yaml index 5f19cf2eb73..8996672c866 100644 --- a/tests/bluetooth/l2cap/testcase.yaml +++ b/tests/bluetooth/l2cap/testcase.yaml @@ -1,7 +1,5 @@ tests: bluetooth.l2cap: - extra_args: - - EXTRA_DTC_OVERLAY_FILE="test.overlay" platform_allow: - native_posix - native_posix/native/64 diff --git a/tests/bluetooth/mesh/blob_io_flash/prj.conf b/tests/bluetooth/mesh/blob_io_flash/prj.conf index 36de7f6b0da..7db7efc16cd 100644 --- a/tests/bluetooth/mesh/blob_io_flash/prj.conf +++ b/tests/bluetooth/mesh/blob_io_flash/prj.conf @@ -10,6 +10,7 @@ CONFIG_FLASH_SIMULATOR=y CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y CONFIG_BT=y +CONFIG_BT_NO_DRIVER=y CONFIG_BT_OBSERVER=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_MESH=y diff --git a/tests/bluetooth/mesh/blob_io_flash/test.overlay b/tests/bluetooth/mesh/blob_io_flash/test.overlay deleted file mode 100644 index 98f90303b70..00000000000 --- a/tests/bluetooth/mesh/blob_io_flash/test.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/ { - chosen { - /delete-property/ zephyr,bt-hci; - }; -}; - -&bt_hci_userchan { - status = "disabled"; -}; diff --git a/tests/bluetooth/mesh/blob_io_flash/testcase.yaml b/tests/bluetooth/mesh/blob_io_flash/testcase.yaml index d5ad661d9ef..c27ea3081af 100644 --- a/tests/bluetooth/mesh/blob_io_flash/testcase.yaml +++ b/tests/bluetooth/mesh/blob_io_flash/testcase.yaml @@ -1,7 +1,5 @@ tests: bluetooth.mesh.blob_io_flash: - extra_args: - - EXTRA_DTC_OVERLAY_FILE="test.overlay" platform_allow: - native_posix - native_sim diff --git a/tests/bluetooth/uuid/prj.conf b/tests/bluetooth/uuid/prj.conf index 1f86a43c208..fec5098eecf 100644 --- a/tests/bluetooth/uuid/prj.conf +++ b/tests/bluetooth/uuid/prj.conf @@ -3,4 +3,4 @@ CONFIG_ZTEST=y CONFIG_BT=y CONFIG_BT_CTLR=n -CONFIG_BT_H4=n +CONFIG_BT_NO_DRIVER=y diff --git a/tests/bluetooth/uuid/test.overlay b/tests/bluetooth/uuid/test.overlay deleted file mode 100644 index badbe2f392a..00000000000 --- a/tests/bluetooth/uuid/test.overlay +++ /dev/null @@ -1,5 +0,0 @@ -/ { - chosen { - /delete-property/ zephyr,bt-hci; - }; -}; diff --git a/tests/bluetooth/uuid/testcase.yaml b/tests/bluetooth/uuid/testcase.yaml index e3382e875c9..20e43e29a27 100644 --- a/tests/bluetooth/uuid/testcase.yaml +++ b/tests/bluetooth/uuid/testcase.yaml @@ -1,7 +1,5 @@ tests: bluetooth.uuid: - extra_args: - - EXTRA_DTC_OVERLAY_FILE="test.overlay" platform_allow: - native_posix - native_posix/native/64 From d8bad0431cbcf963e7402390401c9077868c38c9 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 245/825] Revert "[nrf fromtree] Bluetooth: drivers: userchan: don't fail everything if driver init fails" This reverts commit dbdc755a7ae4f089c9742b422329df01fafa46f7. --- drivers/bluetooth/hci/userchan.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/bluetooth/hci/userchan.c b/drivers/bluetooth/hci/userchan.c index a5f6810b82b..d8e796b3af9 100644 --- a/drivers/bluetooth/hci/userchan.c +++ b/drivers/bluetooth/hci/userchan.c @@ -395,23 +395,11 @@ static const struct bt_hci_driver_api uc_drv_api = { .send = uc_send, }; -static int uc_init(const struct device *dev) -{ - if (!arg_found) { - posix_print_warning("Warning: Bluetooth device missing.\n" - "Specify either a local hci interface --bt-dev=hciN\n" - "or a valid hci tcp server --bt-dev=ip_address:port\n"); - return -ENODEV; - } - - return 0; -} - #define UC_DEVICE_INIT(inst) \ static struct uc_data uc_data_##inst = { \ .fd = -1, \ }; \ - DEVICE_DT_INST_DEFINE(inst, uc_init, NULL, &uc_data_##inst, NULL, \ + DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &uc_data_##inst, NULL, \ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &uc_drv_api) DT_INST_FOREACH_STATUS_OKAY(UC_DEVICE_INIT) @@ -468,4 +456,14 @@ static void add_btuserchan_arg(void) native_add_command_line_opts(btuserchan_args); } +static void btuserchan_check_arg(void) +{ + if (!arg_found) { + posix_print_error_and_exit("Error: Bluetooth device missing.\n" + "Specify either a local hci interface --bt-dev=hciN\n" + "or a valid hci tcp server --bt-dev=ip_address:port\n"); + } +} + NATIVE_TASK(add_btuserchan_arg, PRE_BOOT_1, 10); +NATIVE_TASK(btuserchan_check_arg, PRE_BOOT_2, 10); From 799be02e530c3101bc63f6e513e67fb847713b2c Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 246/825] Revert "[nrf fromtree] Bluetooth: drivers: Convert userchan driver to new API" This reverts commit 39052456f6ae00341d74de19f0df0b1ffc54d4e1. --- boards/native/native_posix/Kconfig.defconfig | 4 + boards/native/native_sim/Kconfig.defconfig | 4 + boards/native/native_sim/native_sim.dts | 6 -- drivers/bluetooth/hci/Kconfig | 2 - drivers/bluetooth/hci/userchan.c | 78 ++++++++----------- .../bluetooth/zephyr,bt-hci-userchan.yaml | 11 --- 6 files changed, 42 insertions(+), 63 deletions(-) delete mode 100644 dts/bindings/bluetooth/zephyr,bt-hci-userchan.yaml diff --git a/boards/native/native_posix/Kconfig.defconfig b/boards/native/native_posix/Kconfig.defconfig index 95c89071513..5602c04539d 100644 --- a/boards/native/native_posix/Kconfig.defconfig +++ b/boards/native/native_posix/Kconfig.defconfig @@ -22,6 +22,10 @@ config ETH_NATIVE_POSIX endif # NETWORKING +config BT_USERCHAN + default y + depends on BT_HCI + if CONSOLE config POSIX_ARCH_CONSOLE diff --git a/boards/native/native_sim/Kconfig.defconfig b/boards/native/native_sim/Kconfig.defconfig index aa2440c872d..57bfceac456 100644 --- a/boards/native/native_sim/Kconfig.defconfig +++ b/boards/native/native_sim/Kconfig.defconfig @@ -22,6 +22,10 @@ config ETH_NATIVE_POSIX endif # NETWORKING +config BT_USERCHAN + depends on BT_HCI + default y + if CONSOLE config POSIX_ARCH_CONSOLE diff --git a/boards/native/native_sim/native_sim.dts b/boards/native/native_sim/native_sim.dts index 95b5ee5c065..87d6297f749 100644 --- a/boards/native/native_sim/native_sim.dts +++ b/boards/native/native_sim/native_sim.dts @@ -24,7 +24,6 @@ zephyr,display = &sdl_dc; zephyr,canbus = &can_loopback0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &bt_hci_userchan; }; aliases { @@ -219,9 +218,4 @@ #dma-cells = <1>; stack-size = <4096>; }; - - bt_hci_userchan: bt_hci_userchan { - compatible = "zephyr,bt-hci-userchan"; - status = "okay"; - }; }; diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index a86afba4c16..1580f93f4c8 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -85,8 +85,6 @@ config BT_SILABS_HCI config BT_USERCHAN bool "HCI User Channel based driver" depends on BOARD_NATIVE_POSIX - default y - depends on DT_HAS_ZEPHYR_BT_HCI_USERCHAN_ENABLED help This driver provides access to the local Linux host's Bluetooth adapter using a User Channel HCI socket to the Linux kernel. It diff --git a/drivers/bluetooth/hci/userchan.c b/drivers/bluetooth/hci/userchan.c index d8e796b3af9..8a1ae241274 100644 --- a/drivers/bluetooth/hci/userchan.c +++ b/drivers/bluetooth/hci/userchan.c @@ -30,20 +30,12 @@ #include #include -#include +#include #define LOG_LEVEL CONFIG_BT_HCI_DRIVER_LOG_LEVEL #include LOG_MODULE_REGISTER(bt_driver); -#define DT_DRV_COMPAT zephyr_bt_hci_userchan - -struct uc_data { - int fd; - bt_hci_recv_t recv; - -}; - #define BTPROTO_HCI 1 struct sockaddr_hci { sa_family_t hci_family; @@ -58,6 +50,8 @@ static K_KERNEL_STACK_DEFINE(rx_thread_stack, CONFIG_ARCH_POSIX_RECOMMENDED_STACK_SIZE); static struct k_thread rx_thread_data; +static int uc_fd = -1; + static unsigned short bt_dev_index; #define TCP_ADDR_BUFF_SIZE 16 @@ -164,18 +158,16 @@ static int32_t hci_packet_complete(const uint8_t *buf, uint16_t buf_len) return (int32_t)header_len + payload_len; } -static bool uc_ready(int fd) +static bool uc_ready(void) { - struct pollfd pollfd = { .fd = fd, .events = POLLIN }; + struct pollfd pollfd = { .fd = uc_fd, .events = POLLIN }; return (poll(&pollfd, 1, 0) == 1); } static void rx_thread(void *p1, void *p2, void *p3) { - const struct device *dev = p1; - struct uc_data *uc = dev->data; - + ARG_UNUSED(p1); ARG_UNUSED(p2); ARG_UNUSED(p3); @@ -191,14 +183,14 @@ static void rx_thread(void *p1, void *p2, void *p3) ssize_t len; const uint8_t *frame_start = frame; - if (!uc_ready(uc->fd)) { + if (!uc_ready()) { k_sleep(K_MSEC(1)); continue; } LOG_DBG("calling read()"); - len = read(uc->fd, frame + frame_size, sizeof(frame) - frame_size); + len = read(uc_fd, frame + frame_size, sizeof(frame) - frame_size); if (len < 0) { if (errno == EINTR) { k_yield(); @@ -206,8 +198,8 @@ static void rx_thread(void *p1, void *p2, void *p3) } LOG_ERR("Reading socket failed, errno %d", errno); - close(uc->fd); - uc->fd = -1; + close(uc_fd); + uc_fd = -1; return; } @@ -264,20 +256,18 @@ static void rx_thread(void *p1, void *p2, void *p3) LOG_DBG("Calling bt_recv(%p)", buf); - uc->recv(dev, buf); + bt_recv(buf); } k_yield(); } } -static int uc_send(const struct device *dev, struct net_buf *buf) +static int uc_send(struct net_buf *buf) { - struct uc_data *uc = dev->data; - LOG_DBG("buf %p type %u len %u", buf, bt_buf_get_type(buf), buf->len); - if (uc->fd < 0) { + if (uc_fd < 0) { LOG_ERR("User channel not open"); return -EIO; } @@ -300,7 +290,7 @@ static int uc_send(const struct device *dev, struct net_buf *buf) return -EINVAL; } - if (write(uc->fd, buf->data, buf->len) < 0) { + if (write(uc_fd, buf->data, buf->len) < 0) { return -errno; } @@ -360,28 +350,25 @@ static int user_chan_open(void) return fd; } -static int uc_open(const struct device *dev, bt_hci_recv_t recv) +static int uc_open(void) { - struct uc_data *uc = dev->data; - if (hci_socket) { LOG_DBG("hci%d", bt_dev_index); } else { LOG_DBG("hci %s:%d", ip_addr, port); } - uc->fd = user_chan_open(); - if (uc->fd < 0) { - return uc->fd; - } - uc->recv = recv; + uc_fd = user_chan_open(); + if (uc_fd < 0) { + return uc_fd; + } - LOG_DBG("User Channel opened as fd %d", uc->fd); + LOG_DBG("User Channel opened as fd %d", uc_fd); k_thread_create(&rx_thread_data, rx_thread_stack, K_KERNEL_STACK_SIZEOF(rx_thread_stack), - rx_thread, (void *)dev, NULL, NULL, + rx_thread, NULL, NULL, NULL, K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO), 0, K_NO_WAIT); @@ -390,19 +377,22 @@ static int uc_open(const struct device *dev, bt_hci_recv_t recv) return 0; } -static const struct bt_hci_driver_api uc_drv_api = { - .open = uc_open, - .send = uc_send, +static const struct bt_hci_driver drv = { + .name = "HCI User Channel", + .bus = BT_HCI_DRIVER_BUS_UART, + .open = uc_open, + .send = uc_send, }; -#define UC_DEVICE_INIT(inst) \ - static struct uc_data uc_data_##inst = { \ - .fd = -1, \ - }; \ - DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &uc_data_##inst, NULL, \ - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &uc_drv_api) +static int bt_uc_init(void) +{ + + bt_hci_driver_register(&drv); + + return 0; +} -DT_INST_FOREACH_STATUS_OKAY(UC_DEVICE_INIT) +SYS_INIT(bt_uc_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); static void cmd_bt_dev_found(char *argv, int offset) { diff --git a/dts/bindings/bluetooth/zephyr,bt-hci-userchan.yaml b/dts/bindings/bluetooth/zephyr,bt-hci-userchan.yaml deleted file mode 100644 index 124a2983532..00000000000 --- a/dts/bindings/bluetooth/zephyr,bt-hci-userchan.yaml +++ /dev/null @@ -1,11 +0,0 @@ -description: Bluetooth HCI provided by a Linux HCI user channel socket - -compatible: "zephyr,bt-hci-userchan" - -include: bt-hci.yaml - -properties: - bt-hci-name: - default: "HCI User Channel" - bt-hci-bus: - default: "BT_HCI_BUS_UART" From fb3489130e66439fd8f54216d979ad53755bbd0b Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 247/825] Revert "[nrf fromtree] Bluetooth: userchan: Support TCP fragmentation of HCI packets" This reverts commit 3688d1858b477816e354848d934ccf5970d75d63. --- drivers/bluetooth/hci/userchan.c | 73 +++++++++++--------------------- 1 file changed, 25 insertions(+), 48 deletions(-) diff --git a/drivers/bluetooth/hci/userchan.c b/drivers/bluetooth/hci/userchan.c index 8a1ae241274..4c7b178fa6d 100644 --- a/drivers/bluetooth/hci/userchan.c +++ b/drivers/bluetooth/hci/userchan.c @@ -89,18 +89,16 @@ static struct net_buf *get_rx(const uint8_t *buf) } /** - * @brief Decode the length of an HCI H4 packet and check it's complete + * @brief Decode the length of an HCI H4 packet * @details Decodes packet length according to Bluetooth spec v5.4 Vol 4 Part E * @param buf Pointer to a HCI packet buffer - * @param buf_len Bytes available in the buffer - * @return Length of the complete HCI packet in bytes, -1 if cannot find an HCI - * packet, 0 if more data required. + * @return Length of the HCI packet in bytes, zero if no valid packet found. */ -static int32_t hci_packet_complete(const uint8_t *buf, uint16_t buf_len) +static uint16_t packet_len(const uint8_t *buf) { uint16_t payload_len = 0; + uint8_t header_len = 0; const uint8_t type = buf[0]; - uint8_t header_len = sizeof(type); const uint8_t *hdr = &buf[sizeof(type)]; switch (type) { @@ -109,7 +107,7 @@ static int32_t hci_packet_complete(const uint8_t *buf, uint16_t buf_len) /* Parameter Total Length */ payload_len = cmd->param_len; - header_len += BT_HCI_CMD_HDR_SIZE; + header_len = BT_HCI_CMD_HDR_SIZE; break; } case BT_HCI_H4_ACL: { @@ -117,7 +115,7 @@ static int32_t hci_packet_complete(const uint8_t *buf, uint16_t buf_len) /* Data Total Length */ payload_len = sys_le16_to_cpu(acl->len); - header_len += BT_HCI_ACL_HDR_SIZE; + header_len = BT_HCI_ACL_HDR_SIZE; break; } case BT_HCI_H4_SCO: { @@ -125,7 +123,7 @@ static int32_t hci_packet_complete(const uint8_t *buf, uint16_t buf_len) /* Data_Total_Length */ payload_len = sco->len; - header_len += BT_HCI_SCO_HDR_SIZE; + header_len = BT_HCI_SCO_HDR_SIZE; break; } case BT_HCI_H4_EVT: { @@ -133,7 +131,7 @@ static int32_t hci_packet_complete(const uint8_t *buf, uint16_t buf_len) /* Parameter Total Length */ payload_len = evt->len; - header_len += BT_HCI_EVT_HDR_SIZE; + header_len = BT_HCI_EVT_HDR_SIZE; break; } case BT_HCI_H4_ISO: { @@ -141,21 +139,16 @@ static int32_t hci_packet_complete(const uint8_t *buf, uint16_t buf_len) /* ISO_Data_Load_Length parameter */ payload_len = bt_iso_hdr_len(sys_le16_to_cpu(iso->len)); - header_len += BT_HCI_ISO_HDR_SIZE; + header_len = BT_HCI_ISO_HDR_SIZE; break; } /* If no valid packet type found */ default: LOG_WRN("Unknown packet type 0x%02x", type); - return -1; - } - - /* Request more data */ - if (buf_len < header_len || buf_len - header_len < payload_len) { return 0; } - return (int32_t)header_len + payload_len; + return sizeof(type) + header_len + payload_len; } static bool uc_ready(void) @@ -173,8 +166,6 @@ static void rx_thread(void *p1, void *p2, void *p3) LOG_DBG("started"); - uint16_t frame_size = 0; - while (1) { static uint8_t frame[512]; struct net_buf *buf; @@ -190,7 +181,7 @@ static void rx_thread(void *p1, void *p2, void *p3) LOG_DBG("calling read()"); - len = read(uc_fd, frame + frame_size, sizeof(frame) - frame_size); + len = read(uc_fd, frame, sizeof(frame)); if (len < 0) { if (errno == EINTR) { k_yield(); @@ -203,60 +194,46 @@ static void rx_thread(void *p1, void *p2, void *p3) return; } - frame_size += len; + while (len > 0) { - while (frame_size > 0) { - const uint8_t *buf_add; const uint8_t packet_type = frame_start[0]; - const int32_t decoded_len = hci_packet_complete(frame_start, frame_size); + const uint16_t decoded_len = packet_len(frame_start); - if (decoded_len == -1) { + if (decoded_len == 0) { LOG_ERR("HCI Packet type is invalid, length could not be decoded"); - frame_size = 0; /* Drop buffer */ break; } - if (decoded_len == 0) { - if (frame_size == sizeof(frame)) { - LOG_ERR("HCI Packet (%d bytes) is too big for frame (%d " - "bytes)", - decoded_len, sizeof(frame)); - frame_size = 0; /* Drop buffer */ - break; - } - if (frame_start != frame) { - memmove(frame, frame_start, frame_size); - } - /* Read more */ + if (decoded_len > len) { + LOG_ERR("Decoded HCI packet length (%d bytes) is greater " + "than buffer length (%d bytes)", decoded_len, len); break; } - buf_add = frame_start + sizeof(packet_type); - buf_add_len = decoded_len - sizeof(packet_type); - buf = get_rx(frame_start); - - frame_size -= decoded_len; - frame_start += decoded_len; - if (!buf) { LOG_DBG("Discard adv report due to insufficient buf"); - continue; + goto next; } buf_tailroom = net_buf_tailroom(buf); + buf_add_len = decoded_len - sizeof(packet_type); if (buf_tailroom < buf_add_len) { LOG_ERR("Not enough space in buffer %zu/%zu", buf_add_len, buf_tailroom); net_buf_unref(buf); - continue; + goto next; } - net_buf_add_mem(buf, buf_add, buf_add_len); + net_buf_add_mem(buf, frame_start + sizeof(packet_type), buf_add_len); LOG_DBG("Calling bt_recv(%p)", buf); bt_recv(buf); + +next: + len -= decoded_len; + frame_start += decoded_len; } k_yield(); From fd45f9b3ca92ddf7be4b7052af2610a40b6164eb Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 248/825] Revert "[nrf fromtree] Bluetooth: drivers: hci: Get rid of Kconfig choice" This reverts commit f230cf110ae013b287b624d4838d514ef589ddd8. --- boards/96boards/carbon/Kconfig.defconfig | 5 +++-- boards/ambiq/apollo4p_blue_kxr_evb/Kconfig.defconfig | 5 +++-- boards/espressif/esp32_devkitc_wroom/Kconfig.defconfig | 5 +++-- boards/espressif/esp32_devkitc_wrover/Kconfig.defconfig | 5 +++-- boards/espressif/esp32_ethernet_kit/Kconfig.defconfig | 5 +++-- boards/espressif/esp32c3_devkitm/Kconfig.defconfig | 5 +++-- boards/espressif/esp32s3_devkitc/Kconfig.defconfig | 5 +++-- boards/espressif/esp32s3_devkitm/Kconfig.defconfig | 5 +++-- boards/espressif/esp_wrover_kit/Kconfig.defconfig | 5 +++-- boards/hardkernel/odroid_go/Kconfig.defconfig | 5 +++-- boards/heltec/heltec_wifi_lora32_v2/Kconfig.defconfig | 5 +++-- .../heltec_wireless_stick_lite_v3/Kconfig.defconfig | 5 +++-- boards/infineon/cy8cproto_062_4343w/Kconfig.defconfig | 7 +++++++ boards/infineon/cy8cproto_063_ble/Kconfig.defconfig | 5 +++-- boards/kincony/kincony_kc868_a32/Kconfig.defconfig | 5 +++-- boards/lairdconnect/bl5340_dvk/Kconfig.defconfig | 5 +++-- boards/luatos/esp32c3_luatos_core/Kconfig.defconfig | 5 +++-- boards/luatos/esp32s3_luatos_core/Kconfig.defconfig | 5 +++-- boards/m5stack/m5stack_atom_lite/Kconfig.defconfig | 5 +++-- boards/m5stack/m5stack_atoms3/Kconfig.defconfig | 5 +++-- boards/m5stack/m5stack_atoms3_lite/Kconfig.defconfig | 5 +++-- boards/m5stack/m5stack_core2/Kconfig.defconfig | 5 +++-- boards/m5stack/m5stack_stamps3/Kconfig.defconfig | 5 +++-- boards/m5stack/m5stickc_plus/Kconfig.defconfig | 5 +++-- boards/m5stack/stamp_c3/Kconfig.defconfig | 5 +++-- boards/native/native_posix/Kconfig.defconfig | 5 +++-- boards/native/native_sim/Kconfig.defconfig | 5 +++-- boards/native/nrf_bsim/Kconfig.defconfig | 5 +++-- boards/nordic/nrf5340_audio_dk/Kconfig.defconfig | 5 +++-- boards/nordic/nrf5340dk/Kconfig.defconfig | 5 +++-- boards/nordic/nrf54h20dk/Kconfig.defconfig | 5 +++-- boards/nordic/thingy53/Kconfig.defconfig | 5 +++-- boards/olimex/olimex_esp32_evb/Kconfig.defconfig | 5 +++-- boards/others/icev_wireless/Kconfig.defconfig | 5 +++-- boards/panasonic/pan1783/Kconfig.defconfig | 5 +++-- boards/raytac/mdbt53_db_40/Kconfig.defconfig | 5 +++-- boards/raytac/mdbt53v_db_40/Kconfig.defconfig | 5 +++-- boards/renesas/da1469x_dk_pro/Kconfig.defconfig | 5 +++-- boards/seeed/xiao_esp32c3/Kconfig.defconfig | 5 +++-- boards/seeed/xiao_esp32s3/Kconfig.defconfig | 5 +++-- boards/shields/x_nucleo_bnrg2a1/Kconfig.defconfig | 5 +++-- boards/shields/x_nucleo_idb05a1/Kconfig.defconfig | 5 +++-- boards/silabs/efr32_radio/Kconfig.defconfig | 5 +++-- boards/silabs/efr32_thunderboard/Kconfig.defconfig | 5 +++-- boards/silabs/efr32xg24_dk2601b/Kconfig.defconfig | 5 +++-- boards/st/b_l4s5i_iot01a/Kconfig.defconfig | 5 +++-- boards/st/disco_l475_iot1/Kconfig.defconfig | 5 +++-- boards/st/nucleo_wb55rg/Kconfig.defconfig | 5 +++-- boards/st/sensortile_box/Kconfig.defconfig | 5 +++-- boards/st/sensortile_box_pro/Kconfig.defconfig | 5 +++-- boards/st/steval_stwinbx1/Kconfig.defconfig | 5 +++-- boards/st/stm32l562e_dk/Kconfig.defconfig | 5 +++-- boards/st/stm32wb5mm_dk/Kconfig.defconfig | 5 +++-- boards/st/stm32wb5mmg/Kconfig.defconfig | 5 +++-- boards/vcc-gnd/yd_esp32/Kconfig.defconfig | 5 +++-- boards/waveshare/esp32s3_touch_lcd_1_28/Kconfig.defconfig | 5 +++-- drivers/bluetooth/hci/Kconfig | 6 ++++++ soc/nxp/rw/Kconfig.defconfig | 5 +++-- soc/st/stm32/stm32wbax/Kconfig.defconfig | 5 +++-- .../boards/unit_testing/unit_testing/Kconfig.defconfig | 8 +++++--- 60 files changed, 189 insertions(+), 117 deletions(-) diff --git a/boards/96boards/carbon/Kconfig.defconfig b/boards/96boards/carbon/Kconfig.defconfig index 2cf1bbdc6fc..cede46b95fe 100644 --- a/boards/96boards/carbon/Kconfig.defconfig +++ b/boards/96boards/carbon/Kconfig.defconfig @@ -14,8 +14,9 @@ if BT config SPI default y -config BT_SPI - default y +choice BT_HCI_BUS_TYPE + default BT_SPI +endchoice endif # BT diff --git a/boards/ambiq/apollo4p_blue_kxr_evb/Kconfig.defconfig b/boards/ambiq/apollo4p_blue_kxr_evb/Kconfig.defconfig index 46d8af8ef95..87e1c5a8764 100644 --- a/boards/ambiq/apollo4p_blue_kxr_evb/Kconfig.defconfig +++ b/boards/ambiq/apollo4p_blue_kxr_evb/Kconfig.defconfig @@ -9,8 +9,9 @@ if BT config MAIN_STACK_SIZE default 2048 -config BT_AMBIQ_HCI - default y +choice BT_HCI_BUS_TYPE + default BT_AMBIQ_HCI +endchoice config BT_BUF_ACL_TX_COUNT default 14 diff --git a/boards/espressif/esp32_devkitc_wroom/Kconfig.defconfig b/boards/espressif/esp32_devkitc_wroom/Kconfig.defconfig index 3cafb138007..6da35bf9735 100644 --- a/boards/espressif/esp32_devkitc_wroom/Kconfig.defconfig +++ b/boards/espressif/esp32_devkitc_wroom/Kconfig.defconfig @@ -12,8 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_ESP32_DEVKITC_WROOM_ESP32_PROCPU diff --git a/boards/espressif/esp32_devkitc_wrover/Kconfig.defconfig b/boards/espressif/esp32_devkitc_wrover/Kconfig.defconfig index e2c3cf70383..ba249b4a0a6 100644 --- a/boards/espressif/esp32_devkitc_wrover/Kconfig.defconfig +++ b/boards/espressif/esp32_devkitc_wrover/Kconfig.defconfig @@ -10,8 +10,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_ESP32_DEVKITC_WROVER_ESP32_PROCPU diff --git a/boards/espressif/esp32_ethernet_kit/Kconfig.defconfig b/boards/espressif/esp32_ethernet_kit/Kconfig.defconfig index 8222793d52a..e7f2edb7c05 100644 --- a/boards/espressif/esp32_ethernet_kit/Kconfig.defconfig +++ b/boards/espressif/esp32_ethernet_kit/Kconfig.defconfig @@ -19,8 +19,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_ESP32_ETHERNET_KIT_ESP32_PROCPU diff --git a/boards/espressif/esp32c3_devkitm/Kconfig.defconfig b/boards/espressif/esp32c3_devkitm/Kconfig.defconfig index 9cd90fc1caf..9944bb87195 100644 --- a/boards/espressif/esp32c3_devkitm/Kconfig.defconfig +++ b/boards/espressif/esp32c3_devkitm/Kconfig.defconfig @@ -10,5 +10,6 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice diff --git a/boards/espressif/esp32s3_devkitc/Kconfig.defconfig b/boards/espressif/esp32s3_devkitc/Kconfig.defconfig index a85e047ceae..9b109ab4525 100644 --- a/boards/espressif/esp32s3_devkitc/Kconfig.defconfig +++ b/boards/espressif/esp32s3_devkitc/Kconfig.defconfig @@ -12,8 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_ESP32S3_DEVKITC_ESP32S3_PROCPU diff --git a/boards/espressif/esp32s3_devkitm/Kconfig.defconfig b/boards/espressif/esp32s3_devkitm/Kconfig.defconfig index e24f82b64a6..1905ae5f551 100644 --- a/boards/espressif/esp32s3_devkitm/Kconfig.defconfig +++ b/boards/espressif/esp32s3_devkitm/Kconfig.defconfig @@ -12,8 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_ESP32S3_DEVKITM_ESP32S3_PROCPU diff --git a/boards/espressif/esp_wrover_kit/Kconfig.defconfig b/boards/espressif/esp_wrover_kit/Kconfig.defconfig index 8fd73caab2c..a05a1684d6b 100644 --- a/boards/espressif/esp_wrover_kit/Kconfig.defconfig +++ b/boards/espressif/esp_wrover_kit/Kconfig.defconfig @@ -12,8 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice config DISK_DRIVER_SDMMC default y diff --git a/boards/hardkernel/odroid_go/Kconfig.defconfig b/boards/hardkernel/odroid_go/Kconfig.defconfig index c78115d8985..345a0f4f64e 100644 --- a/boards/hardkernel/odroid_go/Kconfig.defconfig +++ b/boards/hardkernel/odroid_go/Kconfig.defconfig @@ -25,8 +25,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_ODROID_GO_ESP32_PROCPU diff --git a/boards/heltec/heltec_wifi_lora32_v2/Kconfig.defconfig b/boards/heltec/heltec_wifi_lora32_v2/Kconfig.defconfig index eafe4773552..4f459aa0ca4 100644 --- a/boards/heltec/heltec_wifi_lora32_v2/Kconfig.defconfig +++ b/boards/heltec/heltec_wifi_lora32_v2/Kconfig.defconfig @@ -12,8 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_HELTEC_WIFI_LORA32_V2_ESP32_PROCPU diff --git a/boards/heltec/heltec_wireless_stick_lite_v3/Kconfig.defconfig b/boards/heltec/heltec_wireless_stick_lite_v3/Kconfig.defconfig index d92fca42fa3..82915e44b94 100644 --- a/boards/heltec/heltec_wireless_stick_lite_v3/Kconfig.defconfig +++ b/boards/heltec/heltec_wireless_stick_lite_v3/Kconfig.defconfig @@ -13,8 +13,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_HELTEC_WIRELESS_STICK_LITE_V3_ESP32S3_PROCPU diff --git a/boards/infineon/cy8cproto_062_4343w/Kconfig.defconfig b/boards/infineon/cy8cproto_062_4343w/Kconfig.defconfig index 5573b7f0417..270370c7660 100644 --- a/boards/infineon/cy8cproto_062_4343w/Kconfig.defconfig +++ b/boards/infineon/cy8cproto_062_4343w/Kconfig.defconfig @@ -36,6 +36,13 @@ config UART bool default y +config BT_UART + default y + +choice BT_HCI_BUS_TYPE + default BT_H4 +endchoice + endif # BT # Heap Pool Size diff --git a/boards/infineon/cy8cproto_063_ble/Kconfig.defconfig b/boards/infineon/cy8cproto_063_ble/Kconfig.defconfig index a93950668b8..2d079f63a6b 100644 --- a/boards/infineon/cy8cproto_063_ble/Kconfig.defconfig +++ b/boards/infineon/cy8cproto_063_ble/Kconfig.defconfig @@ -6,7 +6,8 @@ if BOARD_CY8CPROTO_063_BLE -config BT_PSOC6_BLESS - default y if BT +choice BT_HCI_BUS_TYPE + default BT_PSOC6_BLESS if BT +endchoice endif # BOARD_CY8CPROTO_063_BLE diff --git a/boards/kincony/kincony_kc868_a32/Kconfig.defconfig b/boards/kincony/kincony_kc868_a32/Kconfig.defconfig index 43a91bfec28..e8705a11f98 100644 --- a/boards/kincony/kincony_kc868_a32/Kconfig.defconfig +++ b/boards/kincony/kincony_kc868_a32/Kconfig.defconfig @@ -10,8 +10,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_KINCONY_KC868_A32_ESP32_PROCPU diff --git a/boards/lairdconnect/bl5340_dvk/Kconfig.defconfig b/boards/lairdconnect/bl5340_dvk/Kconfig.defconfig index ece5d8d8d39..65c005ee286 100644 --- a/boards/lairdconnect/bl5340_dvk/Kconfig.defconfig +++ b/boards/lairdconnect/bl5340_dvk/Kconfig.defconfig @@ -57,8 +57,9 @@ config FLASH_LOAD_SIZE endif # BOARD_BL5340_DVK_NRF5340_CPUAPP_NS -config BT_HCI_IPC - default y if BT +choice BT_HCI_BUS_TYPE + default BT_HCI_IPC if BT +endchoice config HEAP_MEM_POOL_ADD_SIZE_BOARD int diff --git a/boards/luatos/esp32c3_luatos_core/Kconfig.defconfig b/boards/luatos/esp32c3_luatos_core/Kconfig.defconfig index 6454816e243..054ac256729 100644 --- a/boards/luatos/esp32c3_luatos_core/Kconfig.defconfig +++ b/boards/luatos/esp32c3_luatos_core/Kconfig.defconfig @@ -10,5 +10,6 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice diff --git a/boards/luatos/esp32s3_luatos_core/Kconfig.defconfig b/boards/luatos/esp32s3_luatos_core/Kconfig.defconfig index f14d264fb08..093805f235b 100644 --- a/boards/luatos/esp32s3_luatos_core/Kconfig.defconfig +++ b/boards/luatos/esp32s3_luatos_core/Kconfig.defconfig @@ -12,8 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_ESP32S3_LUATOS_CORE_ESP32S3_PROCPU || BOARD_ESP32S3_LUATOS_CORE_ESP32S3_PROCPU_USB diff --git a/boards/m5stack/m5stack_atom_lite/Kconfig.defconfig b/boards/m5stack/m5stack_atom_lite/Kconfig.defconfig index 56e38c448a4..d56d34b22d7 100644 --- a/boards/m5stack/m5stack_atom_lite/Kconfig.defconfig +++ b/boards/m5stack/m5stack_atom_lite/Kconfig.defconfig @@ -12,8 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_M5STACK_ATOM_LITE_ESP32_PROCPU diff --git a/boards/m5stack/m5stack_atoms3/Kconfig.defconfig b/boards/m5stack/m5stack_atoms3/Kconfig.defconfig index 96da63c4d67..c0dadaceeb4 100644 --- a/boards/m5stack/m5stack_atoms3/Kconfig.defconfig +++ b/boards/m5stack/m5stack_atoms3/Kconfig.defconfig @@ -14,8 +14,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_M5STACK_ATOMS3_ESP32S3_PROCPU diff --git a/boards/m5stack/m5stack_atoms3_lite/Kconfig.defconfig b/boards/m5stack/m5stack_atoms3_lite/Kconfig.defconfig index 918a3ae2692..8039b4762cd 100644 --- a/boards/m5stack/m5stack_atoms3_lite/Kconfig.defconfig +++ b/boards/m5stack/m5stack_atoms3_lite/Kconfig.defconfig @@ -14,8 +14,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD config KERNEL_MEM_POOL default y -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_M5STACK_ATOMS3_LITE_ESP32S3_PROCPU diff --git a/boards/m5stack/m5stack_core2/Kconfig.defconfig b/boards/m5stack/m5stack_core2/Kconfig.defconfig index e3aba605716..2c0a21ef88d 100644 --- a/boards/m5stack/m5stack_core2/Kconfig.defconfig +++ b/boards/m5stack/m5stack_core2/Kconfig.defconfig @@ -15,8 +15,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD config KERNEL_MEM_POOL default y -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice config GPIO_HOGS_INIT_PRIORITY default 70 diff --git a/boards/m5stack/m5stack_stamps3/Kconfig.defconfig b/boards/m5stack/m5stack_stamps3/Kconfig.defconfig index f2254332b4b..70493b8d475 100644 --- a/boards/m5stack/m5stack_stamps3/Kconfig.defconfig +++ b/boards/m5stack/m5stack_stamps3/Kconfig.defconfig @@ -14,8 +14,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD config KERNEL_MEM_POOL default y -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_M5STACK_STAMPS3_ESP32S3_PROCPU diff --git a/boards/m5stack/m5stickc_plus/Kconfig.defconfig b/boards/m5stack/m5stickc_plus/Kconfig.defconfig index f9490d98a57..aea1b614a01 100644 --- a/boards/m5stack/m5stickc_plus/Kconfig.defconfig +++ b/boards/m5stack/m5stickc_plus/Kconfig.defconfig @@ -12,8 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice config GPIO_HOGS_INIT_PRIORITY default 70 diff --git a/boards/m5stack/stamp_c3/Kconfig.defconfig b/boards/m5stack/stamp_c3/Kconfig.defconfig index 949f876f7bc..4ce7fe02e12 100644 --- a/boards/m5stack/stamp_c3/Kconfig.defconfig +++ b/boards/m5stack/stamp_c3/Kconfig.defconfig @@ -12,7 +12,8 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD if BT -config BT_ESP32 - default y +choice BT_HCI_BUS_TYPE + default BT_ESP32 +endchoice endif # BT diff --git a/boards/native/native_posix/Kconfig.defconfig b/boards/native/native_posix/Kconfig.defconfig index 5602c04539d..9132dd9c14d 100644 --- a/boards/native/native_posix/Kconfig.defconfig +++ b/boards/native/native_posix/Kconfig.defconfig @@ -22,9 +22,10 @@ config ETH_NATIVE_POSIX endif # NETWORKING -config BT_USERCHAN - default y +choice BT_HCI_BUS_TYPE + default BT_USERCHAN depends on BT_HCI +endchoice if CONSOLE diff --git a/boards/native/native_sim/Kconfig.defconfig b/boards/native/native_sim/Kconfig.defconfig index 57bfceac456..e154d43a525 100644 --- a/boards/native/native_sim/Kconfig.defconfig +++ b/boards/native/native_sim/Kconfig.defconfig @@ -22,9 +22,10 @@ config ETH_NATIVE_POSIX endif # NETWORKING -config BT_USERCHAN +choice BT_HCI_BUS_TYPE + default BT_USERCHAN depends on BT_HCI - default y +endchoice if CONSOLE diff --git a/boards/native/nrf_bsim/Kconfig.defconfig b/boards/native/nrf_bsim/Kconfig.defconfig index 8f418bc684b..81f90836b54 100644 --- a/boards/native/nrf_bsim/Kconfig.defconfig +++ b/boards/native/nrf_bsim/Kconfig.defconfig @@ -60,8 +60,9 @@ if BOARD_NRF5340BSIM_NRF5340_CPUAPP config IPC_SERVICE_BACKEND_RPMSG_SHMEM_RESET default y if IPC_SERVICE_BACKEND_RPMSG -config BT_HCI_IPC - default y if BT +choice BT_HCI_BUS_TYPE + default BT_HCI_IPC +endchoice endif # BOARD_NRF5340BSIM_NRF5340_CPUAPP diff --git a/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig b/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig index 62316a2aeb0..c8d07e2adfa 100644 --- a/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig +++ b/boards/nordic/nrf5340_audio_dk/Kconfig.defconfig @@ -53,8 +53,9 @@ config FLASH_LOAD_SIZE endif # BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS -config BT_HCI_IPC - default y if BT +choice BT_HCI_BUS_TYPE + default BT_HCI_IPC if BT +endchoice config HEAP_MEM_POOL_ADD_SIZE_BOARD int diff --git a/boards/nordic/nrf5340dk/Kconfig.defconfig b/boards/nordic/nrf5340dk/Kconfig.defconfig index 972d8433c90..67d7c7db9d5 100644 --- a/boards/nordic/nrf5340dk/Kconfig.defconfig +++ b/boards/nordic/nrf5340dk/Kconfig.defconfig @@ -60,8 +60,9 @@ config MBOX_NRFX_IPC if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS -config BT_HCI_IPC - default y if BT +choice BT_HCI_BUS_TYPE + default BT_HCI_IPC if BT +endchoice config HEAP_MEM_POOL_ADD_SIZE_BOARD int diff --git a/boards/nordic/nrf54h20dk/Kconfig.defconfig b/boards/nordic/nrf54h20dk/Kconfig.defconfig index a2be74d3648..85d2f713e04 100644 --- a/boards/nordic/nrf54h20dk/Kconfig.defconfig +++ b/boards/nordic/nrf54h20dk/Kconfig.defconfig @@ -3,8 +3,9 @@ if BOARD_NRF54H20DK_NRF54H20_CPUAPP -config BT_HCI_IPC - default y if BT +choice BT_HCI_BUS_TYPE + default BT_HCI_IPC if BT +endchoice endif # BOARD_NRF54H20DK_NRF54H20_CPUAPP diff --git a/boards/nordic/thingy53/Kconfig.defconfig b/boards/nordic/thingy53/Kconfig.defconfig index c2e13fad0ab..d849fda09ed 100644 --- a/boards/nordic/thingy53/Kconfig.defconfig +++ b/boards/nordic/thingy53/Kconfig.defconfig @@ -61,8 +61,9 @@ endif # BOARD_THINGY53_NRF5340_CPUAPP_NS if !TRUSTED_EXECUTION_SECURE -config BT_HCI_IPC - default y if BT +choice BT_HCI_BUS_TYPE + default BT_HCI_IPC if BT +endchoice config HEAP_MEM_POOL_ADD_SIZE_BOARD int diff --git a/boards/olimex/olimex_esp32_evb/Kconfig.defconfig b/boards/olimex/olimex_esp32_evb/Kconfig.defconfig index cc6993e52e6..c15264f5538 100644 --- a/boards/olimex/olimex_esp32_evb/Kconfig.defconfig +++ b/boards/olimex/olimex_esp32_evb/Kconfig.defconfig @@ -12,8 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_OLIMEX_ESP32_EVB_ESP32_PROCPU diff --git a/boards/others/icev_wireless/Kconfig.defconfig b/boards/others/icev_wireless/Kconfig.defconfig index 2aa7b0a4f48..96ed16249d4 100644 --- a/boards/others/icev_wireless/Kconfig.defconfig +++ b/boards/others/icev_wireless/Kconfig.defconfig @@ -8,5 +8,6 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice diff --git a/boards/panasonic/pan1783/Kconfig.defconfig b/boards/panasonic/pan1783/Kconfig.defconfig index 6c70d441e91..ec08e860bbd 100644 --- a/boards/panasonic/pan1783/Kconfig.defconfig +++ b/boards/panasonic/pan1783/Kconfig.defconfig @@ -8,8 +8,9 @@ config MBOX_NRFX_IPC if SOC_NRF5340_CPUAPP_QKAA -config BT_HCI_IPC - default y if BT +choice BT_HCI_BUS_TYPE + default BT_HCI_IPC if BT +endchoice config HEAP_MEM_POOL_ADD_SIZE_BOARD int diff --git a/boards/raytac/mdbt53_db_40/Kconfig.defconfig b/boards/raytac/mdbt53_db_40/Kconfig.defconfig index bb53d3ae8f4..7bb0e9da948 100644 --- a/boards/raytac/mdbt53_db_40/Kconfig.defconfig +++ b/boards/raytac/mdbt53_db_40/Kconfig.defconfig @@ -53,8 +53,9 @@ config FLASH_LOAD_SIZE endif # BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP_NS -config BT_HCI_IPC - default y if BT +choice BT_HCI_BUS_TYPE + default BT_HCI_IPC if BT +endchoice config HEAP_MEM_POOL_ADD_SIZE_BOARD int diff --git a/boards/raytac/mdbt53v_db_40/Kconfig.defconfig b/boards/raytac/mdbt53v_db_40/Kconfig.defconfig index 9573720773d..9cdb1683eed 100644 --- a/boards/raytac/mdbt53v_db_40/Kconfig.defconfig +++ b/boards/raytac/mdbt53v_db_40/Kconfig.defconfig @@ -53,8 +53,9 @@ config FLASH_LOAD_SIZE endif # BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP_NS -config BT_HCI_IPC - default y if BT +choice BT_HCI_BUS_TYPE + default BT_HCI_IPC if BT +endchoice config HEAP_MEM_POOL_ADD_SIZE_BOARD int diff --git a/boards/renesas/da1469x_dk_pro/Kconfig.defconfig b/boards/renesas/da1469x_dk_pro/Kconfig.defconfig index 6b07a144f64..c20c21658d0 100644 --- a/boards/renesas/da1469x_dk_pro/Kconfig.defconfig +++ b/boards/renesas/da1469x_dk_pro/Kconfig.defconfig @@ -50,8 +50,9 @@ config SERIAL_INIT_PRIORITY if BT -config BT_DA1469X - default y +choice BT_HCI_BUS_TYPE + default BT_DA1469X +endchoice config BT_WAIT_NOP default y diff --git a/boards/seeed/xiao_esp32c3/Kconfig.defconfig b/boards/seeed/xiao_esp32c3/Kconfig.defconfig index d641d8be3a9..f70e724ed8e 100644 --- a/boards/seeed/xiao_esp32c3/Kconfig.defconfig +++ b/boards/seeed/xiao_esp32c3/Kconfig.defconfig @@ -8,5 +8,6 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice diff --git a/boards/seeed/xiao_esp32s3/Kconfig.defconfig b/boards/seeed/xiao_esp32s3/Kconfig.defconfig index a1b83409902..424820d78ad 100644 --- a/boards/seeed/xiao_esp32s3/Kconfig.defconfig +++ b/boards/seeed/xiao_esp32s3/Kconfig.defconfig @@ -10,8 +10,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_XIAO_ESP32S3_ESP32S3_PROCPU diff --git a/boards/shields/x_nucleo_bnrg2a1/Kconfig.defconfig b/boards/shields/x_nucleo_bnrg2a1/Kconfig.defconfig index 94ace9e3849..88f16f95dc5 100644 --- a/boards/shields/x_nucleo_bnrg2a1/Kconfig.defconfig +++ b/boards/shields/x_nucleo_bnrg2a1/Kconfig.defconfig @@ -8,8 +8,9 @@ if BT config SPI default y -config BT_SPI - default y +choice BT_HCI_BUS_TYPE + default BT_SPI +endchoice config BT_BLUENRG_ACI default y diff --git a/boards/shields/x_nucleo_idb05a1/Kconfig.defconfig b/boards/shields/x_nucleo_idb05a1/Kconfig.defconfig index 276ee664679..a5fe2515b50 100644 --- a/boards/shields/x_nucleo_idb05a1/Kconfig.defconfig +++ b/boards/shields/x_nucleo_idb05a1/Kconfig.defconfig @@ -8,8 +8,9 @@ if BT config SPI default y -config BT_SPI - default y +choice BT_HCI_BUS_TYPE + default BT_SPI +endchoice config BT_BLUENRG_ACI default y diff --git a/boards/silabs/efr32_radio/Kconfig.defconfig b/boards/silabs/efr32_radio/Kconfig.defconfig index 90a2ab3dd02..ce20c2ef360 100644 --- a/boards/silabs/efr32_radio/Kconfig.defconfig +++ b/boards/silabs/efr32_radio/Kconfig.defconfig @@ -42,8 +42,9 @@ config MAIN_STACK_SIZE default 3072 if PM default 2304 -config BT_SILABS_HCI - default y +choice BT_HCI_BUS_TYPE + default BT_SILABS_HCI +endchoice endif # BT diff --git a/boards/silabs/efr32_thunderboard/Kconfig.defconfig b/boards/silabs/efr32_thunderboard/Kconfig.defconfig index e1c23189e31..9c116263518 100644 --- a/boards/silabs/efr32_thunderboard/Kconfig.defconfig +++ b/boards/silabs/efr32_thunderboard/Kconfig.defconfig @@ -28,8 +28,9 @@ config MAIN_STACK_SIZE default 3072 if PM default 2304 -config BT_SILABS_HCI - default y +choice BT_HCI_BUS_TYPE + default BT_SILABS_HCI +endchoice endif # BT diff --git a/boards/silabs/efr32xg24_dk2601b/Kconfig.defconfig b/boards/silabs/efr32xg24_dk2601b/Kconfig.defconfig index 52d6391c03e..dbd2884e28a 100644 --- a/boards/silabs/efr32xg24_dk2601b/Kconfig.defconfig +++ b/boards/silabs/efr32xg24_dk2601b/Kconfig.defconfig @@ -33,8 +33,9 @@ config MINIMAL_LIBC_MALLOC_ARENA_SIZE config MAIN_STACK_SIZE default 2304 -config BT_SILABS_HCI - default y +choice BT_HCI_BUS_TYPE + default BT_SILABS_HCI +endchoice if SHELL diff --git a/boards/st/b_l4s5i_iot01a/Kconfig.defconfig b/boards/st/b_l4s5i_iot01a/Kconfig.defconfig index 317d096e0ce..0000fc670f3 100644 --- a/boards/st/b_l4s5i_iot01a/Kconfig.defconfig +++ b/boards/st/b_l4s5i_iot01a/Kconfig.defconfig @@ -27,8 +27,9 @@ if BT config SPI default y -config BT_SPI - default y +choice BT_HCI_BUS_TYPE + default BT_SPI +endchoice config BT_BLUENRG_ACI default y diff --git a/boards/st/disco_l475_iot1/Kconfig.defconfig b/boards/st/disco_l475_iot1/Kconfig.defconfig index 808425eae05..b99f7c57511 100644 --- a/boards/st/disco_l475_iot1/Kconfig.defconfig +++ b/boards/st/disco_l475_iot1/Kconfig.defconfig @@ -27,8 +27,9 @@ if BT config SPI default y -config BT_SPI - default y +choice BT_HCI_BUS_TYPE + default BT_SPI +endchoice config BT_BLUENRG_ACI default y diff --git a/boards/st/nucleo_wb55rg/Kconfig.defconfig b/boards/st/nucleo_wb55rg/Kconfig.defconfig index cd63e8d080e..a4822901739 100644 --- a/boards/st/nucleo_wb55rg/Kconfig.defconfig +++ b/boards/st/nucleo_wb55rg/Kconfig.defconfig @@ -5,8 +5,9 @@ if BOARD_NUCLEO_WB55RG -config BT_STM32_IPM - default y +choice BT_HCI_BUS_TYPE + default BT_STM32_IPM depends on BT +endchoice endif diff --git a/boards/st/sensortile_box/Kconfig.defconfig b/boards/st/sensortile_box/Kconfig.defconfig index faa5dc0864c..8e3f0bb1670 100644 --- a/boards/st/sensortile_box/Kconfig.defconfig +++ b/boards/st/sensortile_box/Kconfig.defconfig @@ -10,8 +10,9 @@ if BT config SPI default y -config BT_SPI - default y +choice BT_HCI_BUS_TYPE + default BT_SPI +endchoice config BT_BLUENRG_ACI default y diff --git a/boards/st/sensortile_box_pro/Kconfig.defconfig b/boards/st/sensortile_box_pro/Kconfig.defconfig index caa346b0075..f0271728a9a 100644 --- a/boards/st/sensortile_box_pro/Kconfig.defconfig +++ b/boards/st/sensortile_box_pro/Kconfig.defconfig @@ -10,8 +10,9 @@ if BT config SPI default y -config BT_SPI - default y +choice BT_HCI_BUS_TYPE + default BT_SPI +endchoice config BT_BLUENRG_ACI default y diff --git a/boards/st/steval_stwinbx1/Kconfig.defconfig b/boards/st/steval_stwinbx1/Kconfig.defconfig index 594ebede5a7..f10fea5e293 100644 --- a/boards/st/steval_stwinbx1/Kconfig.defconfig +++ b/boards/st/steval_stwinbx1/Kconfig.defconfig @@ -10,8 +10,9 @@ if BT config SPI default y -config BT_SPI - default y +choice BT_HCI_BUS_TYPE + default BT_SPI +endchoice config BT_BLUENRG_ACI default y diff --git a/boards/st/stm32l562e_dk/Kconfig.defconfig b/boards/st/stm32l562e_dk/Kconfig.defconfig index ed9a04edc17..5dea5bc3a74 100644 --- a/boards/st/stm32l562e_dk/Kconfig.defconfig +++ b/boards/st/stm32l562e_dk/Kconfig.defconfig @@ -10,8 +10,9 @@ if BT config SPI default y -config BT_SPI - default y +choice BT_HCI_BUS_TYPE + default BT_SPI +endchoice config BT_BLUENRG_ACI default y diff --git a/boards/st/stm32wb5mm_dk/Kconfig.defconfig b/boards/st/stm32wb5mm_dk/Kconfig.defconfig index b75d5bdb31d..37be19b4d1c 100644 --- a/boards/st/stm32wb5mm_dk/Kconfig.defconfig +++ b/boards/st/stm32wb5mm_dk/Kconfig.defconfig @@ -5,8 +5,9 @@ if BOARD_STM32WB5MM_DK -config BT_STM32_IPM - default y +choice BT_HCI_BUS_TYPE + default BT_STM32_IPM depends on BT +endchoice endif diff --git a/boards/st/stm32wb5mmg/Kconfig.defconfig b/boards/st/stm32wb5mmg/Kconfig.defconfig index e07cc7210b2..e63531f897b 100644 --- a/boards/st/stm32wb5mmg/Kconfig.defconfig +++ b/boards/st/stm32wb5mmg/Kconfig.defconfig @@ -5,8 +5,9 @@ if BOARD_STM32WB5MMG -config BT_STM32_IPM - default y +choice BT_HCI_BUS_TYPE + default BT_STM32_IPM depends on BT +endchoice endif diff --git a/boards/vcc-gnd/yd_esp32/Kconfig.defconfig b/boards/vcc-gnd/yd_esp32/Kconfig.defconfig index de2f5af5e75..9b7b408dbef 100644 --- a/boards/vcc-gnd/yd_esp32/Kconfig.defconfig +++ b/boards/vcc-gnd/yd_esp32/Kconfig.defconfig @@ -12,8 +12,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_YD_ESP32_ESP32_PROCPU diff --git a/boards/waveshare/esp32s3_touch_lcd_1_28/Kconfig.defconfig b/boards/waveshare/esp32s3_touch_lcd_1_28/Kconfig.defconfig index c0de8c41f7a..33296a8e529 100644 --- a/boards/waveshare/esp32s3_touch_lcd_1_28/Kconfig.defconfig +++ b/boards/waveshare/esp32s3_touch_lcd_1_28/Kconfig.defconfig @@ -10,8 +10,9 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD default 40960 if BT default 4096 -config BT_ESP32 - default y if BT +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice endif # BOARD_ESP32S3_TOUCH_LCD_1_28_ESP32S3_PROCPU diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index 1580f93f4c8..7eaac7cd402 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -10,6 +10,10 @@ config BT_UART select SERIAL select UART_INTERRUPT_DRIVEN + +choice BT_HCI_BUS_TYPE + prompt "Bluetooth HCI driver" + config BT_H4 bool "H:4 UART" select BT_UART @@ -127,6 +131,8 @@ config BT_AMBIQ_HCI Supports Ambiq Bluetooth SoC using SPI as the communication protocol. HCI packets are sent and received as single Byte transfers. +endchoice + if BT_SPI config BT_SPI_INIT_PRIORITY diff --git a/soc/nxp/rw/Kconfig.defconfig b/soc/nxp/rw/Kconfig.defconfig index aad74cce76e..7f1ee72b9cf 100644 --- a/soc/nxp/rw/Kconfig.defconfig +++ b/soc/nxp/rw/Kconfig.defconfig @@ -85,8 +85,9 @@ if BT config FLASH default y -config BT_NXP - default y +choice BT_HCI_BUS_TYPE + default BT_NXP +endchoice config BT_DIS_MANUF default "NXP" diff --git a/soc/st/stm32/stm32wbax/Kconfig.defconfig b/soc/st/stm32/stm32wbax/Kconfig.defconfig index 814d60428d7..3efc1e334f3 100644 --- a/soc/st/stm32/stm32wbax/Kconfig.defconfig +++ b/soc/st/stm32/stm32wbax/Kconfig.defconfig @@ -13,9 +13,10 @@ config STM32_LPTIM_TIMER config STM32_FLASH_PREFETCH default y -config BT_STM32WBA +choice BT_HCI_BUS_TYPE + default BT_STM32WBA depends on BT - default y +endchoice config BT_STM32WBA select DYNAMIC_INTERRUPTS diff --git a/subsys/testsuite/boards/unit_testing/unit_testing/Kconfig.defconfig b/subsys/testsuite/boards/unit_testing/unit_testing/Kconfig.defconfig index 874e5591893..38c6d4b3019 100644 --- a/subsys/testsuite/boards/unit_testing/unit_testing/Kconfig.defconfig +++ b/subsys/testsuite/boards/unit_testing/unit_testing/Kconfig.defconfig @@ -2,10 +2,12 @@ # # Copyright (c) 2022 Nordic Semiconductor +# Bluetooth unit tests expect this backend +choice BT_HCI_BUS_TYPE + default BT_NO_DRIVER +endchoice + # Controller HCI support requires e.g. devicetree, which isn't available # for unit tests. config BT_CTLR_HCI default n - -config BT_NO_DRIVER - default y From a1dfd2d1f9d2cecd4da3d4f21b6d795688ef82c4 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 249/825] Revert "[nrf fromtree] soc: rw61x: Add BLE support for rw61x" This reverts commit aaa0523b8948eac05509ebb86307560f58eca4a7. --- dts/arm/nxp/nxp_rw6xx_common.dtsi | 41 ------------------------------- soc/nxp/rw/CMakeLists.txt | 2 -- soc/nxp/rw/Kconfig.defconfig | 35 -------------------------- soc/nxp/rw/sections.ld | 38 ---------------------------- soc/nxp/rw/soc.h | 3 --- 5 files changed, 119 deletions(-) delete mode 100644 soc/nxp/rw/sections.ld diff --git a/dts/arm/nxp/nxp_rw6xx_common.dtsi b/dts/arm/nxp/nxp_rw6xx_common.dtsi index 60c3dc9d2d5..b02f5fe2814 100644 --- a/dts/arm/nxp/nxp_rw6xx_common.dtsi +++ b/dts/arm/nxp/nxp_rw6xx_common.dtsi @@ -11,7 +11,6 @@ #include #include #include -#include / { chosen { @@ -57,15 +56,6 @@ }; }; }; - - smu1: sram@41380000 { - ranges = <0x0 0x41380000 DT_SIZE_K(510)>; - }; - - smu2: sram@443C0000 { - ranges = <0x0 0x443C0000 DT_SIZE_K(140)>; - }; - }; &sram { @@ -83,30 +73,6 @@ }; }; -&smu1 { - #address-cells = <1>; - #size-cells = <1>; - - smu1_data: memory@0 { - compatible = "zephyr,memory-region","mmio-sram"; - reg = <0x0 DT_SIZE_K(510)>; - zephyr,memory-region = "SMU1"; - zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_RAM) )>; - }; -}; - -&smu2 { - #address-cells = <1>; - #size-cells = <1>; - - smu2_data: memory@0 { - compatible = "zephyr,memory-region","mmio-sram"; - reg = <0x0 DT_SIZE_K(140)>; - zephyr,memory-region = "SMU2"; - zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_RAM) )>; - }; -}; - &peripheral { #address-cells = <1>; #size-cells = <1>; @@ -477,13 +443,6 @@ interrupts = <41 0>; status = "disabled"; }; - - hci: hci_ble { - compatible = "nxp,hci-ble"; - /* first index is the hci interrupt, the second is the wake up done interrupt */ - interrupts = <90 2>, <82 2>; - interrupt-names = "hci_int", "wakeup_int"; - }; }; &flexspi { diff --git a/soc/nxp/rw/CMakeLists.txt b/soc/nxp/rw/CMakeLists.txt index 64b8bd4803a..3790d07afd8 100644 --- a/soc/nxp/rw/CMakeLists.txt +++ b/soc/nxp/rw/CMakeLists.txt @@ -17,5 +17,3 @@ zephyr_linker_sources_ifdef(CONFIG_NXP_RW6XX_BOOT_HEADER set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "") zephyr_include_directories(.) - -zephyr_linker_sources(RAM_SECTIONS sections.ld) diff --git a/soc/nxp/rw/Kconfig.defconfig b/soc/nxp/rw/Kconfig.defconfig index 7f1ee72b9cf..aa62fea1460 100644 --- a/soc/nxp/rw/Kconfig.defconfig +++ b/soc/nxp/rw/Kconfig.defconfig @@ -80,39 +80,4 @@ choice USB_MCUX_CONTROLLER_TYPE default USB_DC_NXP_EHCI endchoice -if BT - -config FLASH - default y - -choice BT_HCI_BUS_TYPE - default BT_NXP -endchoice - -config BT_DIS_MANUF - default "NXP" - -config BT_BUF_EVT_DISCARDABLE_SIZE - default 84 - -config BT_HCI_ACL_FLOW_CONTROL - default n - -config HCI_NXP_ENABLE_AUTO_SLEEP - default y - -config HCI_NXP_SET_CAL_DATA - default y - -config HEAP_MEM_POOL_SIZE - default 256 - -endif # BT - -config NXP_FW_LOADER - default y if (BT || WIFI) - -config NXP_RF_IMU - default y if (BT || WIFI) - endif # SOC_SERIES_RW6XX diff --git a/soc/nxp/rw/sections.ld b/soc/nxp/rw/sections.ld deleted file mode 100644 index 2fe41f042bd..00000000000 --- a/soc/nxp/rw/sections.ld +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2023 NXP - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#define TXQ23_SIZE 0x1080 -#define SMU1_SIZE DT_REG_SIZE(DT_NODELABEL(smu1_data)) -#define SMU2_SIZE DT_REG_SIZE(DT_NODELABEL(smu2_data)) - - -.SMU1 (NOLOAD) : -{ - . = ALIGN(4); - /* CPU3 <-> CPU1 mailbox */ - *(.smu_cpu13_mbox) - KEEP (*(.smu_cpu13_mbox)) - /* CPU3 -> CPU1 TXQ */ - *(.smu_cpu31_txq) - KEEP (*(.smu_cpu31_txq)) - /* Left space is reserved for CPU3/CPU1 operations */ - . += SMU1_SIZE - .; -} > SMU1 - -.SMU2 (NOLOAD) : -{ - . = ALIGN(4); - /* CPU3 <-> CPU2 mailbox */ - *(.smu_cpu23_mbox) - KEEP (*(.smu_cpu23_mbox)) - /* Reserve space for CPU1 -> CPU3 TXQ (allocated by the CPU2) */ - . += TXQ23_SIZE; - /* CPU3 -> CPU2 TXQ */ - *(.smu_cpu32_txq) - KEEP (*(.smu_cpu32_txq)) - /* Left space is reserved for CPU3/CPU2 operations */ - . += SMU2_SIZE - .; -} > SMU2 diff --git a/soc/nxp/rw/soc.h b/soc/nxp/rw/soc.h index 13f451493e9..780bd9b66aa 100644 --- a/soc/nxp/rw/soc.h +++ b/soc/nxp/rw/soc.h @@ -16,9 +16,6 @@ #endif /* !_ASMLANGUAGE */ -#define ble_hci_handler BLE_MCI_WAKEUP0_DriverIRQHandler -#define ble_wakeup_done_handler BLE_MCI_WAKEUP_DONE0_DriverIRQHandler - /* Wrapper Function to deal with SDK differences in power API */ static inline void EnableDeepSleepIRQ(IRQn_Type irq) { From 2fb9885dbd0417ee589dff7bb46ea0d5f4694b87 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 250/825] Revert "[nrf fromtree] boards: st: steval_stwinbx1: Add BLE support for STEVAL-STWINBX1 board" This reverts commit 6ecec85e653a1c4cba7d5db160961d792375c234. --- boards/st/steval_stwinbx1/Kconfig.defconfig | 18 ------------------ boards/st/steval_stwinbx1/steval_stwinbx1.dts | 17 ----------------- boards/st/steval_stwinbx1/steval_stwinbx1.yaml | 1 - 3 files changed, 36 deletions(-) diff --git a/boards/st/steval_stwinbx1/Kconfig.defconfig b/boards/st/steval_stwinbx1/Kconfig.defconfig index f10fea5e293..be9fa9523a5 100644 --- a/boards/st/steval_stwinbx1/Kconfig.defconfig +++ b/boards/st/steval_stwinbx1/Kconfig.defconfig @@ -5,24 +5,6 @@ if BOARD_STEVAL_STWINBX1 -if BT - -config SPI - default y - -choice BT_HCI_BUS_TYPE - default BT_SPI -endchoice - -config BT_BLUENRG_ACI - default y - -# Disable Flow control -config BT_HCI_ACL_FLOW_CONTROL - default n - -endif # BT - config SPI_STM32_INTERRUPT default y depends on SPI diff --git a/boards/st/steval_stwinbx1/steval_stwinbx1.dts b/boards/st/steval_stwinbx1/steval_stwinbx1.dts index 23eda67338a..d84b9fae9cd 100644 --- a/boards/st/steval_stwinbx1/steval_stwinbx1.dts +++ b/boards/st/steval_stwinbx1/steval_stwinbx1.dts @@ -159,23 +159,6 @@ stm32_lp_tick_source: &lptim1 { status = "okay"; }; -&spi3 { - pinctrl-0 = <&spi3_sck_pg9 &spi3_miso_pb4 &spi3_mosi_pb5>; - pinctrl-names = "default"; - status = "okay"; - cs-gpios = <&gpioe 1 GPIO_ACTIVE_LOW>; - bluenrg-2@0 { - compatible = "st,hci-spi-v2"; - reg = <0>; - reset-gpios = <&gpiod 13 GPIO_ACTIVE_LOW>; - irq-gpios = <&gpiof 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; - spi-cpha; /* CPHA=1 */ - spi-hold-cs; - spi-max-frequency = ; - reset-assert-duration-ms = <6>; - }; -}; - &i2c2 { pinctrl-0 = <&i2c2_scl_ph4 &i2c2_sda_pf0>; pinctrl-names = "default"; diff --git a/boards/st/steval_stwinbx1/steval_stwinbx1.yaml b/boards/st/steval_stwinbx1/steval_stwinbx1.yaml index f08afe0d21d..a12712dda8a 100644 --- a/boards/st/steval_stwinbx1/steval_stwinbx1.yaml +++ b/boards/st/steval_stwinbx1/steval_stwinbx1.yaml @@ -12,5 +12,4 @@ supported: - gpio - pwm - watchdog - - ble vendor: st From 1bbdc3f17e514c2f94235158663b7ef4d22698fc Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 251/825] Revert "[nrf fromtree] Bluetooth: drivers: h5: Convert to new HCI driver API" This reverts commit 959a3a142ac78422c46d28bc51ea4790aacb5fe5. --- drivers/bluetooth/hci/Kconfig | 2 - drivers/bluetooth/hci/h5.c | 418 ++++++++---------- .../bluetooth/zephyr,bt-hci-3wire-uart.yaml | 13 - tests/bluetooth/init/h5.overlay | 16 - tests/bluetooth/init/testcase.yaml | 8 +- 5 files changed, 192 insertions(+), 265 deletions(-) delete mode 100644 dts/bindings/bluetooth/zephyr,bt-hci-3wire-uart.yaml delete mode 100644 tests/bluetooth/init/h5.overlay diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index 7eaac7cd402..f5008429fc0 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -27,8 +27,6 @@ config BT_H5 bool "H:5 UART [EXPERIMENTAL]" select BT_UART select EXPERIMENTAL - default y - depends on DT_HAS_ZEPHYR_BT_HCI_3WIRE_UART_ENABLED help Bluetooth three-wire (H:5) UART driver. Implementation of HCI Three-Wire UART Transport Layer. diff --git a/drivers/bluetooth/hci/h5.c b/drivers/bluetooth/hci/h5.c index 0be22f61f88..25a3b3e28f6 100644 --- a/drivers/bluetooth/hci/h5.c +++ b/drivers/bluetooth/hci/h5.c @@ -17,13 +17,11 @@ #include #include #include -#include -#include #include #include #include -#include +#include #include "../util.h" @@ -31,7 +29,14 @@ #include LOG_MODULE_REGISTER(bt_driver); -#define DT_DRV_COMPAT zephyr_bt_hci_3wire_uart +static K_KERNEL_STACK_DEFINE(tx_stack, CONFIG_BT_DRV_TX_STACK_SIZE); +static K_KERNEL_STACK_DEFINE(rx_stack, CONFIG_BT_DRV_RX_STACK_SIZE); + +static struct k_thread tx_thread_data; +static struct k_thread rx_thread_data; + +static struct k_work_delayable ack_work; +static struct k_work_delayable retx_work; #define HCI_3WIRE_ACK_PKT 0x00 #define HCI_COMMAND_PKT 0x01 @@ -81,21 +86,13 @@ static bool reliable_packet(uint8_t type) #define H5_SET_LEN(hdr, len) (((hdr)[1] |= ((len) & 0x0f) << 4), \ ((hdr)[2] |= (len) >> 4)) -struct h5_data { - /* Needed for delayed work callbacks */ - const struct device *dev; - - bt_hci_recv_t recv; - +static struct h5 { struct net_buf *rx_buf; struct k_fifo tx_queue; struct k_fifo rx_queue; struct k_fifo unack_queue; - struct k_work_delayable ack_work; - struct k_work_delayable retx_work; - uint8_t tx_win; uint8_t tx_ack; uint8_t tx_seq; @@ -114,21 +111,9 @@ struct h5_data { PAYLOAD, END, } rx_state; +} h5; - uint8_t unack_queue_len; -}; - -struct h5_config { - const struct device *uart; - - k_thread_stack_t *rx_stack; - size_t rx_stack_size; - struct k_thread *rx_thread; - - k_thread_stack_t *tx_stack; - size_t tx_stack_size; - struct k_thread *tx_thread; -}; +static uint8_t unack_queue_len; static const uint8_t sync_req[] = { 0x01, 0x7e }; static const uint8_t sync_rsp[] = { 0x02, 0x7d }; @@ -138,21 +123,23 @@ static const uint8_t conf_rsp[] = { 0x04, 0x7b }; /* H5 signal buffers pool */ #define MAX_SIG_LEN 3 -#define SIGNAL_COUNT (2 * DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT)) +#define SIGNAL_COUNT 2 #define SIG_BUF_SIZE (BT_BUF_RESERVE + MAX_SIG_LEN) NET_BUF_POOL_DEFINE(h5_pool, SIGNAL_COUNT, SIG_BUF_SIZE, 0, NULL); -static void h5_reset_rx(struct h5_data *h5) +static const struct device *const h5_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_uart)); + +static void h5_reset_rx(void) { - if (h5->rx_buf) { - net_buf_unref(h5->rx_buf); - h5->rx_buf = NULL; + if (h5.rx_buf) { + net_buf_unref(h5.rx_buf); + h5.rx_buf = NULL; } - h5->rx_state = START; + h5.rx_state = START; } -static int h5_unslip_byte(const struct device *uart, uint8_t *byte) +static int h5_unslip_byte(uint8_t *byte) { int count; @@ -161,7 +148,7 @@ static int h5_unslip_byte(const struct device *uart, uint8_t *byte) } do { - count = uart_fifo_read(uart, byte, sizeof(*byte)); + count = uart_fifo_read(h5_dev, byte, sizeof(*byte)); } while (!count); switch (*byte) { @@ -179,20 +166,20 @@ static int h5_unslip_byte(const struct device *uart, uint8_t *byte) return 0; } -static void process_unack(struct h5_data *h5) +static void process_unack(void) { - uint8_t next_seq = h5->tx_seq; - uint8_t number_removed = h5->unack_queue_len; + uint8_t next_seq = h5.tx_seq; + uint8_t number_removed = unack_queue_len; - if (!h5->unack_queue_len) { + if (!unack_queue_len) { return; } - LOG_DBG("rx_ack %u tx_ack %u tx_seq %u unack_queue_len %u", h5->rx_ack, h5->tx_ack, - h5->tx_seq, h5->unack_queue_len); + LOG_DBG("rx_ack %u tx_ack %u tx_seq %u unack_queue_len %u", h5.rx_ack, h5.tx_ack, h5.tx_seq, + unack_queue_len); - while (h5->unack_queue_len > 0) { - if (next_seq == h5->rx_ack) { + while (unack_queue_len > 0) { + if (next_seq == h5.rx_ack) { /* Next sequence number is the same as last received * ack number */ @@ -204,15 +191,15 @@ static void process_unack(struct h5_data *h5) next_seq = (next_seq - 1) & 0x07; } - if (next_seq != h5->rx_ack) { - LOG_ERR("Wrong sequence: rx_ack %u tx_seq %u next_seq %u", h5->rx_ack, - h5->tx_seq, next_seq); + if (next_seq != h5.rx_ack) { + LOG_ERR("Wrong sequence: rx_ack %u tx_seq %u next_seq %u", h5.rx_ack, h5.tx_seq, + next_seq); } LOG_DBG("Need to remove %u packet from the queue", number_removed); while (number_removed) { - struct net_buf *buf = net_buf_get(&h5->unack_queue, K_NO_WAIT); + struct net_buf *buf = net_buf_get(&h5.unack_queue, K_NO_WAIT); if (!buf) { LOG_ERR("Unack queue is empty"); @@ -223,7 +210,7 @@ static void process_unack(struct h5_data *h5) LOG_DBG("Remove buf from the unack_queue"); net_buf_unref(buf); - h5->unack_queue_len--; + unack_queue_len--; number_removed--; } } @@ -274,27 +261,25 @@ static void hexdump(const char *str, const uint8_t *packet, size_t length) #define hexdump(str, packet, length) #endif -static uint8_t h5_slip_byte(const struct device *uart, uint8_t byte) +static uint8_t h5_slip_byte(uint8_t byte) { switch (byte) { case SLIP_DELIMITER: - uart_poll_out(uart, SLIP_ESC); - uart_poll_out(uart, SLIP_ESC_DELIM); + uart_poll_out(h5_dev, SLIP_ESC); + uart_poll_out(h5_dev, SLIP_ESC_DELIM); return 2; case SLIP_ESC: - uart_poll_out(uart, SLIP_ESC); - uart_poll_out(uart, SLIP_ESC_ESC); + uart_poll_out(h5_dev, SLIP_ESC); + uart_poll_out(h5_dev, SLIP_ESC_ESC); return 2; default: - uart_poll_out(uart, byte); + uart_poll_out(h5_dev, byte); return 1; } } -static void h5_send(const struct device *dev, const uint8_t *payload, uint8_t type, int len) +static void h5_send(const uint8_t *payload, uint8_t type, int len) { - const struct h5_config *cfg = dev->config; - struct h5_data *h5 = dev->data; uint8_t hdr[4]; int i; @@ -303,14 +288,14 @@ static void h5_send(const struct device *dev, const uint8_t *payload, uint8_t ty (void)memset(hdr, 0, sizeof(hdr)); /* Set ACK for outgoing packet and stop delayed work */ - H5_SET_ACK(hdr, h5->tx_ack); + H5_SET_ACK(hdr, h5.tx_ack); /* If cancel fails we may ack the same seq number twice, this is OK. */ - (void)k_work_cancel_delayable(&h5->ack_work); + (void)k_work_cancel_delayable(&ack_work); if (reliable_packet(type)) { H5_SET_RELIABLE(hdr); - H5_SET_SEQ(hdr, h5->tx_seq); - h5->tx_seq = (h5->tx_seq + 1) % 8; + H5_SET_SEQ(hdr, h5.tx_seq); + h5.tx_seq = (h5.tx_seq + 1) % 8; } H5_SET_TYPE(hdr, type); @@ -321,100 +306,97 @@ static void h5_send(const struct device *dev, const uint8_t *payload, uint8_t ty h5_print_header(hdr, "TX: <"); - uart_poll_out(cfg->uart, SLIP_DELIMITER); + uart_poll_out(h5_dev, SLIP_DELIMITER); for (i = 0; i < 4; i++) { - h5_slip_byte(cfg->uart, hdr[i]); + h5_slip_byte(hdr[i]); } for (i = 0; i < len; i++) { - h5_slip_byte(cfg->uart, payload[i]); + h5_slip_byte(payload[i]); } - uart_poll_out(cfg->uart, SLIP_DELIMITER); + uart_poll_out(h5_dev, SLIP_DELIMITER); } /* Delayed work taking care about retransmitting packets */ static void retx_timeout(struct k_work *work) { - struct k_work_delayable *delayable = k_work_delayable_from_work(work); - struct h5_data *h5 = CONTAINER_OF(delayable, struct h5_data, retx_work); + ARG_UNUSED(work); - LOG_DBG("unack_queue_len %u", h5->unack_queue_len); + LOG_DBG("unack_queue_len %u", unack_queue_len); - if (h5->unack_queue_len) { + if (unack_queue_len) { struct k_fifo tmp_queue; struct net_buf *buf; k_fifo_init(&tmp_queue); /* Queue to temporary queue */ - while ((buf = net_buf_get(&h5->tx_queue, K_NO_WAIT))) { + while ((buf = net_buf_get(&h5.tx_queue, K_NO_WAIT))) { net_buf_put(&tmp_queue, buf); } /* Queue unack packets to the beginning of the queue */ - while ((buf = net_buf_get(&h5->unack_queue, K_NO_WAIT))) { + while ((buf = net_buf_get(&h5.unack_queue, K_NO_WAIT))) { /* include also packet type */ net_buf_push(buf, sizeof(uint8_t)); - net_buf_put(&h5->tx_queue, buf); - h5->tx_seq = (h5->tx_seq - 1) & 0x07; - h5->unack_queue_len--; + net_buf_put(&h5.tx_queue, buf); + h5.tx_seq = (h5.tx_seq - 1) & 0x07; + unack_queue_len--; } /* Queue saved packets from temp queue */ while ((buf = net_buf_get(&tmp_queue, K_NO_WAIT))) { - net_buf_put(&h5->tx_queue, buf); + net_buf_put(&h5.tx_queue, buf); } } } static void ack_timeout(struct k_work *work) { - struct k_work_delayable *delayable = k_work_delayable_from_work(work); - struct h5_data *h5 = CONTAINER_OF(delayable, struct h5_data, ack_work); + ARG_UNUSED(work); LOG_DBG(""); - h5_send(h5->dev, NULL, HCI_3WIRE_ACK_PKT, 0); + h5_send(NULL, HCI_3WIRE_ACK_PKT, 0); } -static void h5_process_complete_packet(const struct device *dev, uint8_t *hdr) +static void h5_process_complete_packet(uint8_t *hdr) { - struct h5_data *h5 = dev->data; struct net_buf *buf; LOG_DBG(""); /* rx_ack should be in every packet */ - h5->rx_ack = H5_HDR_ACK(hdr); + h5.rx_ack = H5_HDR_ACK(hdr); if (reliable_packet(H5_HDR_PKT_TYPE(hdr))) { /* For reliable packet increment next transmit ack number */ - h5->tx_ack = (h5->tx_ack + 1) % 8; + h5.tx_ack = (h5.tx_ack + 1) % 8; /* Submit delayed work to ack the packet */ - k_work_reschedule(&h5->ack_work, H5_RX_ACK_TIMEOUT); + k_work_reschedule(&ack_work, H5_RX_ACK_TIMEOUT); } h5_print_header(hdr, "RX: >"); - process_unack(h5); + process_unack(); - buf = h5->rx_buf; - h5->rx_buf = NULL; + buf = h5.rx_buf; + h5.rx_buf = NULL; switch (H5_HDR_PKT_TYPE(hdr)) { case HCI_3WIRE_ACK_PKT: net_buf_unref(buf); break; case HCI_3WIRE_LINK_PKT: - net_buf_put(&h5->rx_queue, buf); + net_buf_put(&h5.rx_queue, buf); break; case HCI_EVENT_PKT: case HCI_ACLDATA_PKT: case HCI_ISODATA_PKT: hexdump("=> ", buf->data, buf->len); - h5->recv(dev, buf); + bt_recv(buf); break; } } @@ -424,21 +406,22 @@ static inline struct net_buf *get_evt_buf(uint8_t evt) return bt_buf_get_evt(evt, false, K_NO_WAIT); } -static void bt_uart_isr(const struct device *uart, void *user_data) +static void bt_uart_isr(const struct device *unused, void *user_data) { - const struct device *dev = user_data; - struct h5_data *h5 = dev->data; static int remaining; uint8_t byte; int ret; static uint8_t hdr[4]; size_t buf_tailroom; - while (uart_irq_update(uart) && - uart_irq_is_pending(uart)) { + ARG_UNUSED(unused); + ARG_UNUSED(user_data); + + while (uart_irq_update(h5_dev) && + uart_irq_is_pending(h5_dev)) { - if (!uart_irq_rx_ready(uart)) { - if (uart_irq_tx_ready(uart)) { + if (!uart_irq_rx_ready(h5_dev)) { + if (uart_irq_tx_ready(h5_dev)) { LOG_DBG("transmit ready"); } else { LOG_DBG("spurious interrupt"); @@ -447,15 +430,15 @@ static void bt_uart_isr(const struct device *uart, void *user_data) break; } - ret = uart_fifo_read(uart, &byte, sizeof(byte)); + ret = uart_fifo_read(h5_dev, &byte, sizeof(byte)); if (!ret) { continue; } - switch (h5->rx_state) { + switch (h5.rx_state) { case START: if (byte == SLIP_DELIMITER) { - h5->rx_state = HEADER; + h5.rx_state = HEADER; remaining = sizeof(hdr); } break; @@ -468,8 +451,8 @@ static void bt_uart_isr(const struct device *uart, void *user_data) continue; } - if (h5_unslip_byte(uart, &byte) < 0) { - h5_reset_rx(h5); + if (h5_unslip_byte(&byte) < 0) { + h5_reset_rx(); continue; } @@ -487,85 +470,86 @@ static void bt_uart_isr(const struct device *uart, void *user_data) /* The buffer is allocated only once we know * the exact event type. */ - h5->rx_state = PAYLOAD; + h5.rx_state = PAYLOAD; break; case HCI_ACLDATA_PKT: - h5->rx_buf = bt_buf_get_rx(BT_BUF_ACL_IN, - K_NO_WAIT); - if (!h5->rx_buf) { + h5.rx_buf = bt_buf_get_rx(BT_BUF_ACL_IN, + K_NO_WAIT); + if (!h5.rx_buf) { LOG_WRN("No available data buffers"); - h5_reset_rx(h5); + h5_reset_rx(); continue; } - h5->rx_state = PAYLOAD; + h5.rx_state = PAYLOAD; break; case HCI_ISODATA_PKT: - h5->rx_buf = bt_buf_get_rx(BT_BUF_ISO_IN, K_NO_WAIT); - if (!h5->rx_buf) { + h5.rx_buf = bt_buf_get_rx(BT_BUF_ISO_IN, + K_NO_WAIT); + if (!h5.rx_buf) { LOG_WRN("No available data buffers"); - h5_reset_rx(h5); + h5_reset_rx(); continue; } - h5->rx_state = PAYLOAD; + h5.rx_state = PAYLOAD; break; case HCI_3WIRE_LINK_PKT: case HCI_3WIRE_ACK_PKT: - h5->rx_buf = net_buf_alloc(&h5_pool, K_NO_WAIT); - if (!h5->rx_buf) { + h5.rx_buf = net_buf_alloc(&h5_pool, K_NO_WAIT); + if (!h5.rx_buf) { LOG_WRN("No available signal buffers"); - h5_reset_rx(h5); + h5_reset_rx(); continue; } - h5->rx_state = PAYLOAD; + h5.rx_state = PAYLOAD; break; default: LOG_ERR("Wrong packet type %u", H5_HDR_PKT_TYPE(hdr)); - h5->rx_state = END; + h5.rx_state = END; break; } if (!remaining) { - h5->rx_state = END; + h5.rx_state = END; } break; case PAYLOAD: - if (h5_unslip_byte(uart, &byte) < 0) { - h5_reset_rx(h5); + if (h5_unslip_byte(&byte) < 0) { + h5_reset_rx(); continue; } /* Allocate HCI event buffer now that we know the * exact event type. */ - if (!h5->rx_buf) { - h5->rx_buf = get_evt_buf(byte); - if (!h5->rx_buf) { + if (!h5.rx_buf) { + h5.rx_buf = get_evt_buf(byte); + if (!h5.rx_buf) { LOG_WRN("No available event buffers"); - h5_reset_rx(h5); + h5_reset_rx(); continue; } } - buf_tailroom = net_buf_tailroom(h5->rx_buf); + buf_tailroom = net_buf_tailroom(h5.rx_buf); if (buf_tailroom < sizeof(byte)) { LOG_ERR("Not enough space in buffer %zu/%zu", sizeof(byte), buf_tailroom); - h5_reset_rx(h5); + h5_reset_rx(); break; } - net_buf_add_mem(h5->rx_buf, &byte, sizeof(byte)); + net_buf_add_mem(h5.rx_buf, &byte, sizeof(byte)); remaining--; if (!remaining) { - h5->rx_state = END; + h5.rx_state = END; } break; case END: if (byte != SLIP_DELIMITER) { LOG_ERR("Missing ending SLIP_DELIMITER"); - h5_reset_rx(h5); + h5_reset_rx(); break; } @@ -576,15 +560,15 @@ static void bt_uart_isr(const struct device *uart, void *user_data) * full packet anyway to clear UART. */ if (H5_HDR_RELIABLE(hdr) && - H5_HDR_SEQ(hdr) != h5->tx_ack) { - LOG_ERR("Seq expected %u got %u. Drop packet", h5->tx_ack, + H5_HDR_SEQ(hdr) != h5.tx_ack) { + LOG_ERR("Seq expected %u got %u. Drop packet", h5.tx_ack, H5_HDR_SEQ(hdr)); - h5_reset_rx(h5); + h5_reset_rx(); break; } - h5_process_complete_packet(dev, hdr); - h5->rx_state = START; + h5_process_complete_packet(hdr); + h5.rx_state = START; break; } } @@ -595,9 +579,8 @@ static uint8_t h5_get_type(struct net_buf *buf) return net_buf_pull_u8(buf); } -static int h5_queue(const struct device *dev, struct net_buf *buf) +static int h5_queue(struct net_buf *buf) { - struct h5_data *h5 = dev->data; uint8_t type; LOG_DBG("buf %p type %u len %u", buf, bt_buf_get_type(buf), buf->len); @@ -619,31 +602,29 @@ static int h5_queue(const struct device *dev, struct net_buf *buf) memcpy(net_buf_push(buf, sizeof(type)), &type, sizeof(type)); - net_buf_put(&h5->tx_queue, buf); + net_buf_put(&h5.tx_queue, buf); return 0; } static void tx_thread(void *p1, void *p2, void *p3) { - const struct device *dev = p1; - struct h5_data *h5 = dev->data; - + ARG_UNUSED(p1); ARG_UNUSED(p2); ARG_UNUSED(p3); LOG_DBG(""); /* FIXME: make periodic sending */ - h5_send(dev, sync_req, HCI_3WIRE_LINK_PKT, sizeof(sync_req)); + h5_send(sync_req, HCI_3WIRE_LINK_PKT, sizeof(sync_req)); while (true) { struct net_buf *buf; uint8_t type; - LOG_DBG("link_state %u", h5->link_state); + LOG_DBG("link_state %u", h5.link_state); - switch (h5->link_state) { + switch (h5.link_state) { case UNINIT: /* FIXME: send sync */ k_sleep(K_MSEC(100)); @@ -653,34 +634,32 @@ static void tx_thread(void *p1, void *p2, void *p3) k_sleep(K_MSEC(100)); break; case ACTIVE: - buf = net_buf_get(&h5->tx_queue, K_FOREVER); + buf = net_buf_get(&h5.tx_queue, K_FOREVER); type = h5_get_type(buf); - h5_send(dev, buf->data, type, buf->len); + h5_send(buf->data, type, buf->len); /* buf is dequeued from tx_queue and queued to unack * queue. */ - net_buf_put(&h5->unack_queue, buf); - h5->unack_queue_len++; + net_buf_put(&h5.unack_queue, buf); + unack_queue_len++; - k_work_reschedule(&h5->retx_work, H5_TX_ACK_TIMEOUT); + k_work_reschedule(&retx_work, H5_TX_ACK_TIMEOUT); break; } } } -static void h5_set_txwin(struct h5_data *h5, uint8_t *conf) +static void h5_set_txwin(uint8_t *conf) { - conf[2] = h5->tx_win & 0x07; + conf[2] = h5.tx_win & 0x07; } static void rx_thread(void *p1, void *p2, void *p3) { - const struct device *dev = p1; - struct h5_data *h5 = dev->data; - + ARG_UNUSED(p1); ARG_UNUSED(p2); ARG_UNUSED(p3); @@ -689,42 +668,42 @@ static void rx_thread(void *p1, void *p2, void *p3) while (true) { struct net_buf *buf; - buf = net_buf_get(&h5->rx_queue, K_FOREVER); + buf = net_buf_get(&h5.rx_queue, K_FOREVER); hexdump("=> ", buf->data, buf->len); if (!memcmp(buf->data, sync_req, sizeof(sync_req))) { - if (h5->link_state == ACTIVE) { + if (h5.link_state == ACTIVE) { /* TODO Reset H5 */ } - h5_send(dev, sync_rsp, HCI_3WIRE_LINK_PKT, sizeof(sync_rsp)); + h5_send(sync_rsp, HCI_3WIRE_LINK_PKT, sizeof(sync_rsp)); } else if (!memcmp(buf->data, sync_rsp, sizeof(sync_rsp))) { - if (h5->link_state == ACTIVE) { + if (h5.link_state == ACTIVE) { /* TODO Reset H5 */ } - h5->link_state = INIT; - h5_set_txwin(h5, conf_req); - h5_send(dev, conf_req, HCI_3WIRE_LINK_PKT, sizeof(conf_req)); + h5.link_state = INIT; + h5_set_txwin(conf_req); + h5_send(conf_req, HCI_3WIRE_LINK_PKT, sizeof(conf_req)); } else if (!memcmp(buf->data, conf_req, 2)) { /* * The Host sends Config Response messages without a * Configuration Field. */ - h5_send(dev, conf_rsp, HCI_3WIRE_LINK_PKT, sizeof(conf_rsp)); + h5_send(conf_rsp, HCI_3WIRE_LINK_PKT, sizeof(conf_rsp)); /* Then send Config Request with Configuration Field */ - h5_set_txwin(h5, conf_req); - h5_send(dev, conf_req, HCI_3WIRE_LINK_PKT, sizeof(conf_req)); + h5_set_txwin(conf_req); + h5_send(conf_req, HCI_3WIRE_LINK_PKT, sizeof(conf_req)); } else if (!memcmp(buf->data, conf_rsp, 2)) { - h5->link_state = ACTIVE; + h5.link_state = ACTIVE; if (buf->len > 2) { /* Configuration field present */ - h5->tx_win = (buf->data[2] & 0x07); + h5.tx_win = (buf->data[2] & 0x07); } - LOG_DBG("Finished H5 configuration, tx_win %u", h5->tx_win); + LOG_DBG("Finished H5 configuration, tx_win %u", h5.tx_win); } else { LOG_ERR("Not handled yet %x %x", buf->data[0], buf->data[1]); } @@ -738,91 +717,74 @@ static void rx_thread(void *p1, void *p2, void *p3) } } -static void h5_init(const struct device *dev) +static void h5_init(void) { - const struct h5_config *cfg = dev->config; - struct h5_data *h5 = dev->data; - k_tid_t tid; - LOG_DBG(""); - h5->link_state = UNINIT; - h5->rx_state = START; - h5->tx_win = 4U; + h5.link_state = UNINIT; + h5.rx_state = START; + h5.tx_win = 4U; /* TX thread */ - k_fifo_init(&h5->tx_queue); - tid = k_thread_create(cfg->tx_thread, cfg->tx_stack, cfg->tx_stack_size, - tx_thread, (void *)dev, NULL, NULL, - K_PRIO_COOP(CONFIG_BT_HCI_TX_PRIO), - 0, K_NO_WAIT); - k_thread_name_set(tid, "tx_thread"); - - k_fifo_init(&h5->rx_queue); - tid = k_thread_create(cfg->rx_thread, cfg->rx_stack, cfg->rx_stack_size, - rx_thread, (void *)dev, NULL, NULL, - K_PRIO_COOP(CONFIG_BT_RX_PRIO), - 0, K_NO_WAIT); - k_thread_name_set(tid, "rx_thread"); + k_fifo_init(&h5.tx_queue); + k_thread_create(&tx_thread_data, tx_stack, + K_KERNEL_STACK_SIZEOF(tx_stack), + tx_thread, NULL, NULL, NULL, + K_PRIO_COOP(CONFIG_BT_HCI_TX_PRIO), + 0, K_NO_WAIT); + k_thread_name_set(&tx_thread_data, "tx_thread"); + + k_fifo_init(&h5.rx_queue); + k_thread_create(&rx_thread_data, rx_stack, + K_KERNEL_STACK_SIZEOF(rx_stack), + rx_thread, NULL, NULL, NULL, + K_PRIO_COOP(CONFIG_BT_RX_PRIO), + 0, K_NO_WAIT); + k_thread_name_set(&rx_thread_data, "rx_thread"); /* Unack queue */ - k_fifo_init(&h5->unack_queue); + k_fifo_init(&h5.unack_queue); /* Init delayed work */ - k_work_init_delayable(&h5->ack_work, ack_timeout); - k_work_init_delayable(&h5->retx_work, retx_timeout); + k_work_init_delayable(&ack_work, ack_timeout); + k_work_init_delayable(&retx_work, retx_timeout); } -static int h5_open(const struct device *dev, bt_hci_recv_t recv) +static int h5_open(void) { - const struct h5_config *cfg = dev->config; - struct h5_data *h5 = dev->data; - LOG_DBG(""); - /* This is needed so that we can access the device struct from within the - * delayed work callbacks. - */ - h5->dev = dev; - - h5->recv = recv; + uart_irq_rx_disable(h5_dev); + uart_irq_tx_disable(h5_dev); - uart_irq_rx_disable(cfg->uart); - uart_irq_tx_disable(cfg->uart); + bt_uart_drain(h5_dev); - bt_uart_drain(cfg->uart); + uart_irq_callback_set(h5_dev, bt_uart_isr); - uart_irq_callback_user_data_set(cfg->uart, bt_uart_isr, (void *)dev); + h5_init(); - h5_init(dev); - - uart_irq_rx_enable(cfg->uart); + uart_irq_rx_enable(h5_dev); return 0; } -static const struct bt_hci_driver_api h5_driver_api = { - .open = h5_open, - .send = h5_queue, +static const struct bt_hci_driver drv = { + .name = "H:5", + .bus = BT_HCI_DRIVER_BUS_UART, + .open = h5_open, + .send = h5_queue, }; -#define BT_UART_DEVICE_INIT(inst) \ - static K_KERNEL_STACK_DEFINE(rx_thread_stack_##inst, CONFIG_BT_DRV_RX_STACK_SIZE); \ - static struct k_thread rx_thread_##inst; \ - static K_KERNEL_STACK_DEFINE(tx_thread_stack_##inst, CONFIG_BT_DRV_TX_STACK_SIZE); \ - static struct k_thread tx_thread_##inst; \ - static const struct h5_config h5_config_##inst = { \ - .uart = DEVICE_DT_GET(DT_INST_PARENT(inst)), \ - .rx_stack = rx_thread_stack_##inst, \ - .rx_stack_size = K_KERNEL_STACK_SIZEOF(rx_thread_stack_##inst), \ - .rx_thread = &rx_thread_##inst, \ - .tx_stack = tx_thread_stack_##inst, \ - .tx_stack_size = K_KERNEL_STACK_SIZEOF(tx_thread_stack_##inst), \ - .tx_thread = &tx_thread_##inst, \ - }; \ - static struct h5_data h5_##inst; \ - DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &h5_##inst, &h5_config_##inst, \ - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &h5_driver_api) - - -DT_INST_FOREACH_STATUS_OKAY(BT_UART_DEVICE_INIT) +static int bt_uart_init(void) +{ + + if (!device_is_ready(h5_dev)) { + return -ENODEV; + } + + bt_hci_driver_register(&drv); + + return 0; +} + +SYS_INIT(bt_uart_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/dts/bindings/bluetooth/zephyr,bt-hci-3wire-uart.yaml b/dts/bindings/bluetooth/zephyr,bt-hci-3wire-uart.yaml deleted file mode 100644 index d2a5f62c213..00000000000 --- a/dts/bindings/bluetooth/zephyr,bt-hci-3wire-uart.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# UART Bluetooth HCI device - -description: Bluetooth HCI behind a 3-Wire UART device (H:5) - -compatible: "zephyr,bt-hci-3wire-uart" - -include: bt-hci.yaml - -properties: - bt-hci-name: - default: "H:5" - bt-hci-bus: - default: "BT_HCI_BUS_UART" diff --git a/tests/bluetooth/init/h5.overlay b/tests/bluetooth/init/h5.overlay deleted file mode 100644 index 8c49815cb09..00000000000 --- a/tests/bluetooth/init/h5.overlay +++ /dev/null @@ -1,16 +0,0 @@ -/ { - chosen { - zephyr,bt-hci = &bt_hci_3wire_uart; - }; -}; - -&bt_hci_uart { - status = "disabled"; -}; - -&uart2 { - bt_hci_3wire_uart: bt_hci_3wire_uart { - compatible = "zephyr,bt-hci-3wire-uart"; - status = "okay"; - }; -}; diff --git a/tests/bluetooth/init/testcase.yaml b/tests/bluetooth/init/testcase.yaml index 69afaaf8b08..63267a96c8e 100644 --- a/tests/bluetooth/init/testcase.yaml +++ b/tests/bluetooth/init/testcase.yaml @@ -326,14 +326,10 @@ tests: - nrf52840dk/nrf52840 - nrf51dk/nrf51822 bluetooth.init.test_h5: - extra_args: - - CONF_FILE=prj_h5.conf - - DTC_OVERLAY_FILE=h5.overlay + extra_args: CONF_FILE=prj_h5.conf platform_allow: qemu_cortex_m3 bluetooth.init.test_h5_dbg: - extra_args: - - CONF_FILE=prj_h5_dbg.conf - - DTC_OVERLAY_FILE=h5.overlay + extra_args: CONF_FILE=prj_h5_dbg.conf platform_allow: qemu_cortex_m3 bluetooth.init.test_llcp: extra_args: CONF_FILE=prj_llcp.conf From 46e176e89dc1f91df6804ec216a4f033f54a803c Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 252/825] Revert "[nrf fromtree] Bluetooth: host: hci_raw: Use existing H4 defines from hci_types.h" This reverts commit 532fe8648676833a48768df4b1506215f0cdf2a6. --- subsys/bluetooth/host/hci_raw.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/subsys/bluetooth/host/hci_raw.c b/subsys/bluetooth/host/hci_raw.c index 64340c22108..227aff84ac9 100644 --- a/subsys/bluetooth/host/hci_raw.c +++ b/subsys/bluetooth/host/hci_raw.c @@ -31,6 +31,12 @@ #include LOG_MODULE_REGISTER(bt_hci_raw); +#define H4_CMD 0x01 +#define H4_ACL 0x02 +#define H4_SCO 0x03 +#define H4_EVT 0x04 +#define H4_ISO 0x05 + static struct k_fifo *raw_rx; #if defined(CONFIG_BT_HCI_RAW_H4_ENABLE) @@ -136,16 +142,16 @@ struct net_buf *bt_buf_get_tx(enum bt_buf_type type, k_timeout_t timeout, uint8_t h4_type = ((uint8_t *)data)[0]; switch (h4_type) { - case BT_HCI_H4_CMD: + case H4_CMD: type = BT_BUF_CMD; pool = &hci_cmd_pool; break; - case BT_HCI_H4_ACL: + case H4_ACL: type = BT_BUF_ACL_OUT; pool = &hci_acl_pool; break; #if defined(CONFIG_BT_ISO) - case BT_HCI_H4_ISO: + case H4_ISO: type = BT_BUF_ISO_OUT; pool = &hci_iso_pool; break; @@ -207,14 +213,14 @@ int bt_recv(struct net_buf *buf) raw_mode == BT_HCI_RAW_MODE_H4) { switch (bt_buf_get_type(buf)) { case BT_BUF_EVT: - net_buf_push_u8(buf, BT_HCI_H4_EVT); + net_buf_push_u8(buf, H4_EVT); break; case BT_BUF_ACL_IN: - net_buf_push_u8(buf, BT_HCI_H4_ACL); + net_buf_push_u8(buf, H4_ACL); break; case BT_BUF_ISO_IN: if (IS_ENABLED(CONFIG_BT_ISO)) { - net_buf_push_u8(buf, BT_HCI_H4_ISO); + net_buf_push_u8(buf, H4_ISO); break; } __fallthrough; From 2c6c474171316847b0faf1c7b6e62b1460bcc221 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 253/825] Revert "[nrf fromtree] Bluetooth: samples: hci_uart_async: Remove bt_recv() dependency" This reverts commit 1a0b5cb5f589c8ad8dfdfc44022475f72e496278. --- samples/bluetooth/hci_uart_async/src/hci_uart_async.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/samples/bluetooth/hci_uart_async/src/hci_uart_async.c b/samples/bluetooth/hci_uart_async/src/hci_uart_async.c index 856ebc47524..e3e32eba4af 100644 --- a/samples/bluetooth/hci_uart_async/src/hci_uart_async.c +++ b/samples/bluetooth/hci_uart_async/src/hci_uart_async.c @@ -151,11 +151,10 @@ static void send_hw_error(void) struct net_buf *buf = bt_buf_get_rx(BT_BUF_EVT, K_FOREVER); - net_buf_add_u8(buf, BT_HCI_H4_EVT); net_buf_add_mem(buf, hci_evt_hw_err, sizeof(hci_evt_hw_err)); /* Inject the message into the c2h queue. */ - net_buf_put(&c2h_queue, buf); + bt_recv(buf); /* The c2h thread will send the message at some point. The host * will receive it and reset the controller. From 107be568d4aa2ff5aafb2be2c6fd5b07b8807c15 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 254/825] Revert "[nrf noup] dts: choose a crypto accelerator for entropy" This reverts commit 7baaf166b3cdd8bdfe0b6bdf8f96edf7ee3f6974. --- dts/arm/nordic/nrf52840.dtsi | 4 ++-- dts/arm/nordic/nrf5340_cpuapp.dtsi | 4 ++-- dts/arm/nordic/nrf54l15_cpuapp.dtsi | 3 +-- dts/arm/nordic/nrf91.dtsi | 3 +-- soc/nordic/common/Kconfig.peripherals | 6 ++---- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index 58e746ac406..120a5a87b13 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -6,7 +6,7 @@ / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &cryptocell; + zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -553,7 +553,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 d48f0ce62dc..e40f6241d91 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -33,7 +33,7 @@ }; chosen { - zephyr,entropy = &cryptocell; + zephyr,entropy = &rng_hci; zephyr,flash-controller = &flash_controller; }; @@ -102,7 +102,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/nrf54l15_cpuapp.dtsi b/dts/arm/nordic/nrf54l15_cpuapp.dtsi index b32b1eef73a..551d344f842 100644 --- a/dts/arm/nordic/nrf54l15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l15_cpuapp.dtsi @@ -19,7 +19,6 @@ cpuflpr_vevif: &cpuflpr_vevif_remote {}; / { chosen { zephyr,bt-hci = &bt_hci_controller; - zephyr,entropy = &psa_rng; }; soc { @@ -30,7 +29,7 @@ cpuflpr_vevif: &cpuflpr_vevif_remote {}; 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 0fb4c4addf4..78502d3f086 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -27,7 +27,6 @@ }; chosen { - zephyr,entropy = &cryptocell; zephyr,flash-controller = &flash_controller; }; @@ -51,7 +50,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 f9b01417677..a6d730804b8 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 d022eea53070f8af5413774f64d7a4c7a56b2ad6 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 255/825] Revert "[nrf fromtree] Bluetooth: controller: Update to new HCI driver API" This reverts commit ffab98f942cfa19942946b049b3b301d667458d6. --- .../rv32m1_vega_openisa_rv32m1_ri5cy.dts | 5 -- drivers/bluetooth/Kconfig | 2 +- dts/arm/nordic/nrf51822.dtsi | 6 -- dts/arm/nordic/nrf52805.dtsi | 6 -- dts/arm/nordic/nrf52810.dtsi | 6 -- dts/arm/nordic/nrf52811.dtsi | 6 -- dts/arm/nordic/nrf52820.dtsi | 6 -- dts/arm/nordic/nrf52832.dtsi | 6 -- dts/arm/nordic/nrf52833.dtsi | 6 -- dts/arm/nordic/nrf52840.dtsi | 6 -- dts/arm/nordic/nrf5340_cpunet.dtsi | 6 -- dts/arm/nordic/nrf54l15_cpuapp.dtsi | 8 -- .../bluetooth/zephyr,bt-hci-ll-sw-split.yaml | 13 --- dts/common/nordic/nrf54l15.dtsi | 5 -- dts/riscv/openisa/rv32m1.dtsi | 5 -- subsys/bluetooth/controller/Kconfig | 1 - subsys/bluetooth/controller/hci/hci_driver.c | 88 ++++++++----------- 17 files changed, 36 insertions(+), 145 deletions(-) delete mode 100644 dts/bindings/bluetooth/zephyr,bt-hci-ll-sw-split.yaml diff --git a/boards/openisa/rv32m1_vega/rv32m1_vega_openisa_rv32m1_ri5cy.dts b/boards/openisa/rv32m1_vega/rv32m1_vega_openisa_rv32m1_ri5cy.dts index 44f3ca3bc6f..b21e9b960ec 100644 --- a/boards/openisa/rv32m1_vega/rv32m1_vega_openisa_rv32m1_ri5cy.dts +++ b/boards/openisa/rv32m1_vega/rv32m1_vega_openisa_rv32m1_ri5cy.dts @@ -19,7 +19,6 @@ zephyr,shell-uart = &lpuart0; zephyr,uart-pipe = &lpuart0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &bt_hci_controller; }; aliases { @@ -27,10 +26,6 @@ }; }; -&bt_hci_controller { - status = "okay"; -}; - &m4_flash { /* * For more information, see: diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index a1680af6583..46bf62bb1a7 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_CTLR if BT_DRIVERS diff --git a/dts/arm/nordic/nrf51822.dtsi b/dts/arm/nordic/nrf51822.dtsi index 11cc9eff2f9..b64de1d4985 100644 --- a/dts/arm/nordic/nrf51822.dtsi +++ b/dts/arm/nordic/nrf51822.dtsi @@ -5,7 +5,6 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -74,11 +73,6 @@ reg = <0x40001000 0x1000>; interrupts = <1 NRF_DEFAULT_IRQ_PRIORITY>; status = "okay"; - - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; - }; }; uart0: uart@40002000 { diff --git a/dts/arm/nordic/nrf52805.dtsi b/dts/arm/nordic/nrf52805.dtsi index b375ef17069..c5a184d5e28 100644 --- a/dts/arm/nordic/nrf52805.dtsi +++ b/dts/arm/nordic/nrf52805.dtsi @@ -9,7 +9,6 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -87,11 +86,6 @@ interrupts = <1 NRF_DEFAULT_IRQ_PRIORITY>; status = "okay"; ble-2mbps-supported; - - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; - }; }; uart0: uart@40002000 { diff --git a/dts/arm/nordic/nrf52810.dtsi b/dts/arm/nordic/nrf52810.dtsi index 0c95fe96e70..1ca4a9ea378 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -5,7 +5,6 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -91,11 +90,6 @@ interrupts = <1 NRF_DEFAULT_IRQ_PRIORITY>; status = "okay"; ble-2mbps-supported; - - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; - }; }; uart0: uart@40002000 { diff --git a/dts/arm/nordic/nrf52811.dtsi b/dts/arm/nordic/nrf52811.dtsi index 2176bfa93c7..63b85676587 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.dtsi @@ -9,7 +9,6 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -103,11 +102,6 @@ compatible = "nordic,nrf-ieee802154"; status = "disabled"; }; - - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; - }; }; uart0: uart@40002000 { diff --git a/dts/arm/nordic/nrf52820.dtsi b/dts/arm/nordic/nrf52820.dtsi index d6bd6e65f66..f93e449b0b2 100644 --- a/dts/arm/nordic/nrf52820.dtsi +++ b/dts/arm/nordic/nrf52820.dtsi @@ -10,7 +10,6 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -99,11 +98,6 @@ compatible = "nordic,nrf-ieee802154"; status = "disabled"; }; - - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; - }; }; uart0: uart@40002000 { diff --git a/dts/arm/nordic/nrf52832.dtsi b/dts/arm/nordic/nrf52832.dtsi index bdb76a05d5b..13ee05226b7 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -5,7 +5,6 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -91,11 +90,6 @@ interrupts = <1 NRF_DEFAULT_IRQ_PRIORITY>; status = "okay"; ble-2mbps-supported; - - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; - }; }; uart0: uart@40002000 { diff --git a/dts/arm/nordic/nrf52833.dtsi b/dts/arm/nordic/nrf52833.dtsi index 40c3f1efcad..f22cb36bc14 100644 --- a/dts/arm/nordic/nrf52833.dtsi +++ b/dts/arm/nordic/nrf52833.dtsi @@ -9,7 +9,6 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -98,11 +97,6 @@ compatible = "nordic,nrf-ieee802154"; status = "disabled"; }; - - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; - }; }; uart0: uart@40002000 { diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index 120a5a87b13..4cfb7abc511 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -5,7 +5,6 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -93,11 +92,6 @@ compatible = "nordic,nrf-ieee802154"; status = "disabled"; }; - - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; - }; }; uart0: uart@40002000 { diff --git a/dts/arm/nordic/nrf5340_cpunet.dtsi b/dts/arm/nordic/nrf5340_cpunet.dtsi index 4e05f4a1df0..8a95b3e9985 100644 --- a/dts/arm/nordic/nrf5340_cpunet.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet.dtsi @@ -9,7 +9,6 @@ / { chosen { - zephyr,bt-hci = &bt_hci_controller; zephyr,entropy = &rng; zephyr,flash-controller = &flash_controller; }; @@ -101,11 +100,6 @@ compatible = "nordic,nrf-ieee802154"; status = "disabled"; }; - - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "okay"; - }; }; rng: random@41009000 { diff --git a/dts/arm/nordic/nrf54l15_cpuapp.dtsi b/dts/arm/nordic/nrf54l15_cpuapp.dtsi index 551d344f842..788bfe5df91 100644 --- a/dts/arm/nordic/nrf54l15_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54l15_cpuapp.dtsi @@ -17,10 +17,6 @@ cpuflpr_vevif: &cpuflpr_vevif_remote {}; /delete-node/ &cpuflpr_clic; / { - chosen { - zephyr,bt-hci = &bt_hci_controller; - }; - soc { compatible = "simple-bus"; interrupt-parent = <&cpuapp_nvic>; @@ -33,10 +29,6 @@ cpuflpr_vevif: &cpuflpr_vevif_remote {}; }; }; -&bt_hci_controller { - status = "okay"; -}; - &cpuapp_ppb { compatible = "simple-bus"; ranges; diff --git a/dts/bindings/bluetooth/zephyr,bt-hci-ll-sw-split.yaml b/dts/bindings/bluetooth/zephyr,bt-hci-ll-sw-split.yaml deleted file mode 100644 index f53cf49e90e..00000000000 --- a/dts/bindings/bluetooth/zephyr,bt-hci-ll-sw-split.yaml +++ /dev/null @@ -1,13 +0,0 @@ -description: Bluetooth HCI provided by the native Zephyr Bluetooth Controller - -compatible: "zephyr,bt-hci-ll-sw-split" - -include: bt-hci.yaml - -properties: - bt-hci-name: - default: "Controller" - bt-hci-bus: - default: "BT_HCI_BUS_VIRTUAL" - bt-hci-quirks: - default: ["BT_HCI_QUIRK_NO_AUTO_DLE"] diff --git a/dts/common/nordic/nrf54l15.dtsi b/dts/common/nordic/nrf54l15.dtsi index 8896b94f874..0b8eb1c549a 100644 --- a/dts/common/nordic/nrf54l15.dtsi +++ b/dts/common/nordic/nrf54l15.dtsi @@ -264,11 +264,6 @@ compatible = "nordic,nrf-ieee802154"; status = "disabled"; }; - - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; - }; }; dppic20: dppic@c2000 { diff --git a/dts/riscv/openisa/rv32m1.dtsi b/dts/riscv/openisa/rv32m1.dtsi index cb234eba998..afbc7c41c23 100644 --- a/dts/riscv/openisa/rv32m1.dtsi +++ b/dts/riscv/openisa/rv32m1.dtsi @@ -524,10 +524,5 @@ write-block-size = <8>; }; }; - - bt_hci_controller: bt_hci_controller { - compatible = "zephyr,bt-hci-ll-sw-split"; - status = "disabled"; - }; }; }; diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index e791f79c537..d80f4c5f61a 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -135,7 +135,6 @@ endchoice config BT_CTLR_HCI bool "Host Controller Interface (HCI)" default y - depends on DT_HAS_ZEPHYR_BT_HCI_LL_SW_SPLIT_ENABLED help Enable the Host Controller interface (HCI) in the Controller. This should almost always be enabled, except in a few special diff --git a/subsys/bluetooth/controller/hci/hci_driver.c b/subsys/bluetooth/controller/hci/hci_driver.c index d5826c9dc59..f174ca02c72 100644 --- a/subsys/bluetooth/controller/hci/hci_driver.c +++ b/subsys/bluetooth/controller/hci/hci_driver.c @@ -21,7 +21,7 @@ #include #include -#include +#include #ifdef CONFIG_CLOCK_CONTROL_NRF #include @@ -66,12 +66,6 @@ #include LOG_MODULE_REGISTER(bt_ctlr_hci_driver); -#define DT_DRV_COMPAT zephyr_bt_hci_ll_sw_split - -struct hci_driver_data { - bt_hci_recv_t recv; -}; - static struct k_sem sem_prio_recv; static struct k_fifo recv_fifo; @@ -126,10 +120,8 @@ static inline uint8_t bt_hci_evt_get_flags(uint8_t evt) * tree) 'recv blocking' API to the normal single-receiver * `bt_recv` API. */ -static int bt_recv_prio(const struct device *dev, struct net_buf *buf) +static int bt_recv_prio(struct net_buf *buf) { - struct hci_driver_data *data = dev->data; - if (bt_buf_get_type(buf) == BT_BUF_EVT) { struct bt_hci_evt_hdr *hdr = (void *)buf->data; uint8_t evt_flags = bt_hci_evt_get_flags(hdr->evt); @@ -141,7 +133,7 @@ static int bt_recv_prio(const struct device *dev, struct net_buf *buf) } } - return data->recv(dev, buf); + return bt_recv(buf); } #if defined(CONFIG_BT_CTLR_ISO) @@ -175,8 +167,6 @@ isoal_status_t sink_sdu_emit_hci(const struct isoal_sink *sink_ctx, const struct isoal_emitted_sdu_frag *sdu_frag, const struct isoal_emitted_sdu *sdu) { - const struct device *dev = DEVICE_DT_GET(DT_DRV_INST(0)); - struct hci_driver_data *data = dev->data; struct bt_hci_iso_sdu_ts_hdr *sdu_hdr; uint16_t packet_status_flag; struct bt_hci_iso_hdr *hdr; @@ -259,7 +249,7 @@ isoal_status_t sink_sdu_emit_hci(const struct isoal_sink *sink_ctx, hdr->len = sys_cpu_to_le16(len); /* send fragment up the chain */ - data->recv(dev, buf); + bt_recv(buf); } return ISOAL_STATUS_OK; @@ -332,8 +322,6 @@ static struct net_buf *process_prio_evt(struct node_rx_pdu *node_rx, */ static void prio_recv_thread(void *p1, void *p2, void *p3) { - const struct device *dev = p1; - while (1) { struct node_rx_pdu *node_rx; struct net_buf *buf; @@ -370,7 +358,7 @@ static void prio_recv_thread(void *p1, void *p2, void *p3) false, K_FOREVER); hci_num_cmplt_encode(buf, handle, num_cmplt); LOG_DBG("Num Complete: 0x%04x:%u", handle, num_cmplt); - bt_recv_prio(dev, buf); + bt_recv_prio(buf); k_yield(); #endif /* CONFIG_BT_CONN || CONFIG_BT_CTLR_ADV_ISO || CONFIG_BT_CTLR_CONN_ISO */ } @@ -394,7 +382,7 @@ static void prio_recv_thread(void *p1, void *p2, void *p3) ll_rx_mem_release((void **)&node_rx); } - bt_recv_prio(dev, buf); + bt_recv_prio(buf); /* bt_recv_prio would not release normal evt * buf. */ @@ -673,9 +661,6 @@ static inline struct net_buf *process_hbuf(struct node_rx_pdu *n) */ static void recv_thread(void *p1, void *p2, void *p3) { - const struct device *dev = p1; - struct hci_driver_data *data = dev->data; - #if defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL) /* @todo: check if the events structure really needs to be static */ static struct k_poll_event events[2] = { @@ -734,7 +719,7 @@ static void recv_thread(void *p1, void *p2, void *p3) LOG_DBG("Packet in: type:%u len:%u", bt_buf_get_type(frag), frag->len); - data->recv(dev, frag); + bt_recv(frag); } else { net_buf_unref(frag); } @@ -744,7 +729,7 @@ static void recv_thread(void *p1, void *p2, void *p3) } } -static int cmd_handle(const struct device *dev, struct net_buf *buf) +static int cmd_handle(struct net_buf *buf) { struct node_rx_pdu *node_rx = NULL; struct net_buf *evt; @@ -752,7 +737,7 @@ static int cmd_handle(const struct device *dev, struct net_buf *buf) evt = hci_cmd_handle(buf, (void **) &node_rx); if (evt) { LOG_DBG("Replying with event of %u bytes", evt->len); - bt_recv_prio(dev, evt); + bt_recv_prio(evt); if (node_rx) { LOG_DBG("RX node enqueue"); @@ -765,7 +750,7 @@ static int cmd_handle(const struct device *dev, struct net_buf *buf) } #if defined(CONFIG_BT_CONN) -static int acl_handle(const struct device *dev, struct net_buf *buf) +static int acl_handle(struct net_buf *buf) { struct net_buf *evt; int err; @@ -773,7 +758,7 @@ static int acl_handle(const struct device *dev, struct net_buf *buf) err = hci_acl_handle(buf, &evt); if (evt) { LOG_DBG("Replying with event of %u bytes", evt->len); - bt_recv_prio(dev, evt); + bt_recv_prio(evt); } return err; @@ -781,7 +766,7 @@ static int acl_handle(const struct device *dev, struct net_buf *buf) #endif /* CONFIG_BT_CONN */ #if defined(CONFIG_BT_CTLR_ADV_ISO) || defined(CONFIG_BT_CTLR_CONN_ISO) -static int iso_handle(const struct device *dev, struct net_buf *buf) +static int iso_handle(struct net_buf *buf) { struct net_buf *evt; int err; @@ -789,14 +774,14 @@ static int iso_handle(const struct device *dev, struct net_buf *buf) err = hci_iso_handle(buf, &evt); if (evt) { LOG_DBG("Replying with event of %u bytes", evt->len); - bt_recv_prio(dev, evt); + bt_recv_prio(evt); } return err; } #endif /* CONFIG_BT_CTLR_ADV_ISO || CONFIG_BT_CTLR_CONN_ISO */ -static int hci_driver_send(const struct device *dev, struct net_buf *buf) +static int hci_driver_send(struct net_buf *buf) { uint8_t type; int err; @@ -812,15 +797,15 @@ static int hci_driver_send(const struct device *dev, struct net_buf *buf) switch (type) { #if defined(CONFIG_BT_CONN) case BT_BUF_ACL_OUT: - err = acl_handle(dev, buf); + err = acl_handle(buf); break; #endif /* CONFIG_BT_CONN */ case BT_BUF_CMD: - err = cmd_handle(dev, buf); + err = cmd_handle(buf); break; #if defined(CONFIG_BT_CTLR_ADV_ISO) || defined(CONFIG_BT_CTLR_CONN_ISO) case BT_BUF_ISO_OUT: - err = iso_handle(dev, buf); + err = iso_handle(buf); break; #endif /* CONFIG_BT_CTLR_ADV_ISO || CONFIG_BT_CTLR_CONN_ISO */ default: @@ -837,9 +822,8 @@ static int hci_driver_send(const struct device *dev, struct net_buf *buf) return err; } -static int hci_driver_open(const struct device *dev, bt_hci_recv_t recv) +static int hci_driver_open(void) { - struct hci_driver_data *data = dev->data; uint32_t err; DEBUG_INIT(); @@ -853,8 +837,6 @@ static int hci_driver_open(const struct device *dev, bt_hci_recv_t recv) return err; } - data->recv = recv; - #if defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL) k_poll_signal_init(&hbuf_signal); hci_init(&hbuf_signal); @@ -864,13 +846,13 @@ static int hci_driver_open(const struct device *dev, bt_hci_recv_t recv) k_thread_create(&prio_recv_thread_data, prio_recv_thread_stack, K_KERNEL_STACK_SIZEOF(prio_recv_thread_stack), - prio_recv_thread, (void *)dev, NULL, NULL, + prio_recv_thread, NULL, NULL, NULL, K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO), 0, K_NO_WAIT); k_thread_name_set(&prio_recv_thread_data, "BT RX pri"); k_thread_create(&recv_thread_data, recv_thread_stack, K_KERNEL_STACK_SIZEOF(recv_thread_stack), - recv_thread, (void *)dev, NULL, NULL, + recv_thread, NULL, NULL, NULL, K_PRIO_COOP(CONFIG_BT_RX_PRIO), 0, K_NO_WAIT); k_thread_name_set(&recv_thread_data, "BT RX"); @@ -879,10 +861,8 @@ static int hci_driver_open(const struct device *dev, bt_hci_recv_t recv) return 0; } -static int hci_driver_close(const struct device *dev) +static int hci_driver_close(void) { - struct hci_driver_data *data = dev->data; - /* Resetting the LL stops all roles */ ll_deinit(); @@ -892,22 +872,24 @@ static int hci_driver_close(const struct device *dev) /* Abort RX thread */ k_thread_abort(&recv_thread_data); - /* Clear the (host) receive callback */ - data->recv = NULL; - return 0; } -static const struct bt_hci_driver_api hci_driver_api = { - .open = hci_driver_open, +static const struct bt_hci_driver drv = { + .name = "Controller", + .bus = BT_HCI_DRIVER_BUS_VIRTUAL, + .quirks = BT_QUIRK_NO_AUTO_DLE, + .open = hci_driver_open, .close = hci_driver_close, - .send = hci_driver_send, + .send = hci_driver_send, }; -#define BT_HCI_CONTROLLER_INIT(inst) \ - static struct hci_driver_data data_##inst; \ - DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &data_##inst, NULL, POST_KERNEL, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &hci_driver_api) +static int hci_driver_init(void) +{ + + bt_hci_driver_register(&drv); + + return 0; +} -/* Only a single instance is supported */ -BT_HCI_CONTROLLER_INIT(0) +SYS_INIT(hci_driver_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); From ae348554408a792a88767e059296297a9905b150 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 256/825] Revert "[nrf fromtree] Bluetooth: drivers: Convert H4 (UART) HCI driver to new API" This reverts commit c56c3faf7c127ad90acd97bff30d3bf5da87b612. --- .../arduino_giga_r1_stm32h747xx_m7.dts | 19 +- .../cy8cproto_062_4343w.dts | 29 +- boards/ite/it82xx2_evb/it82xx2_evb.dts | 7 +- boards/ite/it8xxx2_evb/it8xxx2_evb.dts | 7 +- boards/nxp/hexiwear/hexiwear_mk64f12.dts | 7 +- boards/qemu/cortex_m3/qemu_cortex_m3.dts | 7 +- boards/qemu/x86/qemu_x86.dts | 7 +- boards/shields/frdm_kw41z/frdm_kw41z.overlay | 7 +- boards/st/b_u585i_iot02a/b_u585i_iot02a.dts | 7 +- .../up_squared/up_squared.dts | 9 +- drivers/bluetooth/hci/Kconfig | 2 - drivers/bluetooth/hci/cyw43xxx.c | 6 +- drivers/bluetooth/hci/h4.c | 457 ++++++++---------- .../bluetooth/zephyr,bt-hci-uart.yaml | 13 - .../bluetooth/ll/conn/prj_split_hci_uart.conf | 1 + 15 files changed, 238 insertions(+), 347 deletions(-) delete mode 100644 dts/bindings/bluetooth/zephyr,bt-hci-uart.yaml diff --git a/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m7.dts b/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m7.dts index a0791514b78..0ffb4f75380 100644 --- a/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m7.dts +++ b/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m7.dts @@ -18,7 +18,7 @@ zephyr,console = &usart1; zephyr,shell-uart = &usart1; zephyr,uart-mcumgr = &usart1; - zephyr,bt-hci = &bt_hci_uart; + zephyr,bt-uart = &uart7; zephyr,sram = &sram0; zephyr,flash = &flash0; zephyr,canbus = &fdcan2; @@ -98,17 +98,12 @@ status = "okay"; hw-flow-control; - bt_hci_uart: bt_hci_uart { - compatible = "zephyr,bt-hci-uart"; - status = "okay"; - - murata-1dx { - compatible = "infineon,cyw43xxx-bt-hci"; - bt-reg-on-gpios = <&gpioa 10 GPIO_ACTIVE_HIGH>; - bt-host-wake-gpios = <&gpiog 3 GPIO_ACTIVE_HIGH>; - bt-dev-wake-gpios = <&gpioh 7 GPIO_ACTIVE_HIGH>; - fw-download-speed = <115200>; - }; + murata-1dx { + compatible = "infineon,cyw43xxx-bt-hci"; + bt-reg-on-gpios = <&gpioa 10 GPIO_ACTIVE_HIGH>; + bt-host-wake-gpios = <&gpiog 3 GPIO_ACTIVE_HIGH>; + bt-dev-wake-gpios = <&gpioh 7 GPIO_ACTIVE_HIGH>; + fw-download-speed = <115200>; }; }; diff --git a/boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w.dts b/boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w.dts index b9e74ac685d..7997344dd54 100644 --- a/boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w.dts +++ b/boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w.dts @@ -25,7 +25,7 @@ zephyr,flash = &flash0; zephyr,console = &uart5; zephyr,shell-uart = &uart5; - zephyr,bt-hci = &bt_hci_uart; + zephyr,bt_uart = &uart2; }; }; @@ -58,22 +58,17 @@ uart2: &scb2 { /* HW Flow control must be enabled for HCI H4 */ hw-flow-control; - bt_hci_uart: bt_hci_uart { - compatible = "zephyr,bt-hci-uart"; - - murata-1dx { - status = "okay"; - compatible = "infineon,cyw43xxx-bt-hci"; - bt-reg-on-gpios = <&gpio_prt3 4 (GPIO_ACTIVE_HIGH)>; - - /* Configuration UART speeds for firmware download (fw-download-speed) - * and HCI operation (hci-operation-speed). - * If hci-operation-speed or fw-download-speed are not defined in - * bt-hci{...} node, cyw43xx driver will use bus/current-speed as - * default speed. - */ - fw-download-speed = <3000000>; - }; + bt-hci { + status = "okay"; + compatible = "infineon,cyw43xxx-bt-hci"; + bt-reg-on-gpios = <&gpio_prt3 4 (GPIO_ACTIVE_HIGH)>; + + /* Configuration UART speeds for firmware download (fw-download-speed) and + * HCI operation (hci-operation-speed). + * If hci-operation-speed or fw-download-speed are not defined in bt-hci{...} + * node, cyw43xx driver will use bus/current-speed as default speed. + */ + fw-download-speed = <3000000>; }; }; diff --git a/boards/ite/it82xx2_evb/it82xx2_evb.dts b/boards/ite/it82xx2_evb/it82xx2_evb.dts index 29e8ad721c8..bd623e969c5 100644 --- a/boards/ite/it82xx2_evb/it82xx2_evb.dts +++ b/boards/ite/it82xx2_evb/it82xx2_evb.dts @@ -25,7 +25,7 @@ chosen { zephyr,console = &uart1; zephyr,shell-uart = &uart1; - zephyr,bt-hci = &bt_hci_uart; + zephyr,bt-uart = &uart2; zephyr,sram = &sram0; zephyr,flash = &flash0; zephyr,flash-controller = &flashctrl; @@ -115,11 +115,6 @@ status = "okay"; current-speed = <460800>; clock-frequency = <1843200>; - - bt_hci_uart: bt_hci_uart { - compatible = "zephyr,bt-hci-uart"; - status = "okay"; - }; }; &ite_uart1_wrapper { diff --git a/boards/ite/it8xxx2_evb/it8xxx2_evb.dts b/boards/ite/it8xxx2_evb/it8xxx2_evb.dts index 0ee42f981f0..c111e9092aa 100644 --- a/boards/ite/it8xxx2_evb/it8xxx2_evb.dts +++ b/boards/ite/it8xxx2_evb/it8xxx2_evb.dts @@ -25,7 +25,7 @@ chosen { zephyr,console = &uart1; zephyr,shell-uart = &uart1; - zephyr,bt-hci = &bt_hci_uart; + zephyr,bt-uart = &uart2; zephyr,sram = &sram0; zephyr,flash = &flash0; zephyr,flash-controller = &flashctrl; @@ -105,11 +105,6 @@ status = "okay"; current-speed = <460800>; clock-frequency = <1843200>; - - bt_hci_uart: bt_hci_uart { - compatible = "zephyr,bt-hci-uart"; - status = "okay"; - }; }; &ite_uart1_wrapper { status = "okay"; diff --git a/boards/nxp/hexiwear/hexiwear_mk64f12.dts b/boards/nxp/hexiwear/hexiwear_mk64f12.dts index 519beb04ab7..d530b6e9036 100644 --- a/boards/nxp/hexiwear/hexiwear_mk64f12.dts +++ b/boards/nxp/hexiwear/hexiwear_mk64f12.dts @@ -28,7 +28,7 @@ zephyr,code-partition = &slot0_partition; zephyr,console = &uart0; zephyr,shell-uart = &uart0; - zephyr,bt-hci = &bt_hci_uart; + zephyr,bt-uart = &uart4; }; leds { @@ -153,11 +153,6 @@ current-speed = <115200>; pinctrl-0 = <&uart4_default>; pinctrl-names = "default"; - - bt_hci_uart: bt_hci_uart { - compatible = "zephyr,bt-hci-uart"; - status = "okay"; - }; }; &gpioa { diff --git a/boards/qemu/cortex_m3/qemu_cortex_m3.dts b/boards/qemu/cortex_m3/qemu_cortex_m3.dts index b035736a9f7..2e0bd95755f 100644 --- a/boards/qemu/cortex_m3/qemu_cortex_m3.dts +++ b/boards/qemu/cortex_m3/qemu_cortex_m3.dts @@ -20,7 +20,7 @@ zephyr,flash = &flash0; zephyr,console = &uart0; zephyr,shell-uart = &uart0; - zephyr,bt-hci = &bt_hci_uart; + zephyr,bt-uart = &uart2; zephyr,uart-pipe = &uart1; zephyr,bt-mon-uart = &uart2; }; @@ -39,11 +39,6 @@ &uart2 { status = "okay"; current-speed = <115200>; - - bt_hci_uart: bt_hci_uart { - compatible = "zephyr,bt-hci-uart"; - status = "okay"; - }; }; ð { diff --git a/boards/qemu/x86/qemu_x86.dts b/boards/qemu/x86/qemu_x86.dts index 907e8a1ec1c..023c551eb47 100644 --- a/boards/qemu/x86/qemu_x86.dts +++ b/boards/qemu/x86/qemu_x86.dts @@ -37,8 +37,8 @@ zephyr,sram = &dram0; zephyr,flash = &flash0; zephyr,console = &uart0; - zephyr,bt-hci = &bt_hci_uart; zephyr,shell-uart = &uart0; + zephyr,bt-uart = &uart1; zephyr,uart-pipe = &uart1; zephyr,bt-mon-uart = &uart1; zephyr,code-partition = &slot0_partition; @@ -125,11 +125,6 @@ &uart1 { status = "okay"; current-speed = <115200>; - - bt_hci_uart: bt_hci_uart { - compatible = "zephyr,bt-hci-uart"; - status = "okay"; - }; }; &hpet { diff --git a/boards/shields/frdm_kw41z/frdm_kw41z.overlay b/boards/shields/frdm_kw41z/frdm_kw41z.overlay index 8e9f14fbfb4..3807b2f6a2d 100644 --- a/boards/shields/frdm_kw41z/frdm_kw41z.overlay +++ b/boards/shields/frdm_kw41z/frdm_kw41z.overlay @@ -6,16 +6,11 @@ / { chosen { - zephyr,bt-hci = &bt_hci_uart; + zephyr,bt-uart = &arduino_serial; }; }; &arduino_serial { status = "okay"; current-speed = <115200>; - - bt_hci_uart: bt_hci_uart { - compatible = "zephyr,bt-hci-uart"; - status = "okay"; - }; }; diff --git a/boards/st/b_u585i_iot02a/b_u585i_iot02a.dts b/boards/st/b_u585i_iot02a/b_u585i_iot02a.dts index e8c81ca083a..33093d701b7 100644 --- a/boards/st/b_u585i_iot02a/b_u585i_iot02a.dts +++ b/boards/st/b_u585i_iot02a/b_u585i_iot02a.dts @@ -17,7 +17,7 @@ zephyr,sram = &sram0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &bt_hci_uart; + zephyr,bt-uart=&uart4; }; aliases { @@ -71,9 +71,4 @@ pinctrl-names = "default"; current-speed = <100000>; status = "okay"; - - bt_hci_uart: bt_hci_uart { - compatible = "zephyr,bt-hci-uart"; - status = "okay"; - }; }; diff --git a/boards/up-bridge-the-gap/up_squared/up_squared.dts b/boards/up-bridge-the-gap/up_squared/up_squared.dts index 2e8e763115f..beb83af8b19 100644 --- a/boards/up-bridge-the-gap/up_squared/up_squared.dts +++ b/boards/up-bridge-the-gap/up_squared/up_squared.dts @@ -25,7 +25,7 @@ zephyr,sram = &dram0; zephyr,console = &uart0; zephyr,shell-uart = &uart0; - zephyr,bt-hci = &bt_hci_uart; + zephyr,bt-uart = &uart1; zephyr,uart-pipe = &uart1; zephyr,bt-mon-uart = &uart1; }; @@ -49,10 +49,3 @@ }; }; }; - -&uart1 { - bt_hci_uart: bt_hci_uart { - compatible = "zephyr,bt-hci-uart"; - status = "okay"; - }; -}; diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index f5008429fc0..ba117d695c0 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -17,8 +17,6 @@ choice BT_HCI_BUS_TYPE config BT_H4 bool "H:4 UART" select BT_UART - default y - depends on DT_HAS_ZEPHYR_BT_HCI_UART_ENABLED help Bluetooth H:4 UART driver. Requires hardware flow control lines to be available. diff --git a/drivers/bluetooth/hci/cyw43xxx.c b/drivers/bluetooth/hci/cyw43xxx.c index 252b40129d7..8da6192610d 100644 --- a/drivers/bluetooth/hci/cyw43xxx.c +++ b/drivers/bluetooth/hci/cyw43xxx.c @@ -25,11 +25,11 @@ LOG_MODULE_REGISTER(cyw43xxx_driver); #include -#define DT_DRV_COMPAT infineon_cyw43xxx_bt_hci - -BUILD_ASSERT(DT_PROP(DT_INST_GPARENT(0), hw_flow_control) == 1, +BUILD_ASSERT(DT_PROP(DT_CHOSEN(zephyr_bt_uart), hw_flow_control) == 1, "hw_flow_control must be enabled for HCI H4 UART"); +#define DT_DRV_COMPAT infineon_cyw43xxx_bt_hci + /* BT settling time after power on */ #define BT_POWER_ON_SETTLING_TIME_MS (500u) diff --git a/drivers/bluetooth/hci/h4.c b/drivers/bluetooth/hci/h4.c index 412214c7f32..16b28b52586 100644 --- a/drivers/bluetooth/hci/h4.c +++ b/drivers/bluetooth/hci/h4.c @@ -20,7 +20,7 @@ #include #include -#include +#include #define LOG_LEVEL CONFIG_BT_HCI_DRIVER_LOG_LEVEL #include @@ -30,183 +30,168 @@ LOG_MODULE_REGISTER(bt_driver); #include "../util.h" -#define DT_DRV_COMPAT zephyr_bt_hci_uart +static K_KERNEL_STACK_DEFINE(rx_thread_stack, CONFIG_BT_DRV_RX_STACK_SIZE); +static struct k_thread rx_thread_data; -struct h4_data { - struct { - struct net_buf *buf; - struct k_fifo fifo; - - uint16_t remaining; - uint16_t discard; - - bool have_hdr; - bool discardable; +static struct { + struct net_buf *buf; + struct k_fifo fifo; - uint8_t hdr_len; + uint16_t remaining; + uint16_t discard; - uint8_t type; - union { - struct bt_hci_evt_hdr evt; - struct bt_hci_acl_hdr acl; - struct bt_hci_iso_hdr iso; - uint8_t hdr[4]; - }; - } rx; + bool have_hdr; + bool discardable; - struct { - uint8_t type; - struct net_buf *buf; - struct k_fifo fifo; - } tx; + uint8_t hdr_len; - bt_hci_recv_t recv; + uint8_t type; + union { + struct bt_hci_evt_hdr evt; + struct bt_hci_acl_hdr acl; + struct bt_hci_iso_hdr iso; + uint8_t hdr[4]; + }; +} rx = { + .fifo = Z_FIFO_INITIALIZER(rx.fifo), }; -struct h4_config { - const struct device *uart; - k_thread_stack_t *rx_thread_stack; - size_t rx_thread_stack_size; - struct k_thread *rx_thread; +static struct { + uint8_t type; + struct net_buf *buf; + struct k_fifo fifo; +} tx = { + .fifo = Z_FIFO_INITIALIZER(tx.fifo), }; -static inline void h4_get_type(const struct device *dev) -{ - const struct h4_config *cfg = dev->config; - struct h4_data *h4 = dev->data; +static const struct device *const h4_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_uart)); +static inline void h4_get_type(void) +{ /* Get packet type */ - if (uart_fifo_read(cfg->uart, &h4->rx.type, 1) != 1) { + if (uart_fifo_read(h4_dev, &rx.type, 1) != 1) { LOG_WRN("Unable to read H:4 packet type"); - h4->rx.type = BT_HCI_H4_NONE; + rx.type = BT_HCI_H4_NONE; return; } - switch (h4->rx.type) { + switch (rx.type) { case BT_HCI_H4_EVT: - h4->rx.remaining = sizeof(h4->rx.evt); - h4->rx.hdr_len = h4->rx.remaining; + rx.remaining = sizeof(rx.evt); + rx.hdr_len = rx.remaining; break; case BT_HCI_H4_ACL: - h4->rx.remaining = sizeof(h4->rx.acl); - h4->rx.hdr_len = h4->rx.remaining; + rx.remaining = sizeof(rx.acl); + rx.hdr_len = rx.remaining; break; case BT_HCI_H4_ISO: if (IS_ENABLED(CONFIG_BT_ISO)) { - h4->rx.remaining = sizeof(h4->rx.iso); - h4->rx.hdr_len = h4->rx.remaining; + rx.remaining = sizeof(rx.iso); + rx.hdr_len = rx.remaining; break; } __fallthrough; default: - LOG_ERR("Unknown H:4 type 0x%02x", h4->rx.type); - h4->rx.type = BT_HCI_H4_NONE; + LOG_ERR("Unknown H:4 type 0x%02x", rx.type); + rx.type = BT_HCI_H4_NONE; } } -static void h4_read_hdr(const struct device *dev) +static void h4_read_hdr(void) { - const struct h4_config *cfg = dev->config; - struct h4_data *h4 = dev->data; - int bytes_read = h4->rx.hdr_len - h4->rx.remaining; + int bytes_read = rx.hdr_len - rx.remaining; int ret; - ret = uart_fifo_read(cfg->uart, h4->rx.hdr + bytes_read, h4->rx.remaining); + ret = uart_fifo_read(h4_dev, rx.hdr + bytes_read, rx.remaining); if (unlikely(ret < 0)) { LOG_ERR("Unable to read from UART (ret %d)", ret); } else { - h4->rx.remaining -= ret; + rx.remaining -= ret; } } -static inline void get_acl_hdr(const struct device *dev) +static inline void get_acl_hdr(void) { - struct h4_data *h4 = dev->data; + h4_read_hdr(); - h4_read_hdr(dev); + if (!rx.remaining) { + struct bt_hci_acl_hdr *hdr = &rx.acl; - if (!h4->rx.remaining) { - struct bt_hci_acl_hdr *hdr = &h4->rx.acl; - - h4->rx.remaining = sys_le16_to_cpu(hdr->len); - LOG_DBG("Got ACL header. Payload %u bytes", h4->rx.remaining); - h4->rx.have_hdr = true; + rx.remaining = sys_le16_to_cpu(hdr->len); + LOG_DBG("Got ACL header. Payload %u bytes", rx.remaining); + rx.have_hdr = true; } } -static inline void get_iso_hdr(const struct device *dev) +static inline void get_iso_hdr(void) { - struct h4_data *h4 = dev->data; - - h4_read_hdr(dev); + h4_read_hdr(); - if (!h4->rx.remaining) { - struct bt_hci_iso_hdr *hdr = &h4->rx.iso; + if (!rx.remaining) { + struct bt_hci_iso_hdr *hdr = &rx.iso; - h4->rx.remaining = bt_iso_hdr_len(sys_le16_to_cpu(hdr->len)); - LOG_DBG("Got ISO header. Payload %u bytes", h4->rx.remaining); - h4->rx.have_hdr = true; + rx.remaining = bt_iso_hdr_len(sys_le16_to_cpu(hdr->len)); + LOG_DBG("Got ISO header. Payload %u bytes", rx.remaining); + rx.have_hdr = true; } } -static inline void get_evt_hdr(const struct device *dev) +static inline void get_evt_hdr(void) { - struct h4_data *h4 = dev->data; - - struct bt_hci_evt_hdr *hdr = &h4->rx.evt; + struct bt_hci_evt_hdr *hdr = &rx.evt; - h4_read_hdr(dev); + h4_read_hdr(); - if (h4->rx.hdr_len == sizeof(*hdr) && h4->rx.remaining < sizeof(*hdr)) { - switch (h4->rx.evt.evt) { + if (rx.hdr_len == sizeof(*hdr) && rx.remaining < sizeof(*hdr)) { + switch (rx.evt.evt) { case BT_HCI_EVT_LE_META_EVENT: - h4->rx.remaining++; - h4->rx.hdr_len++; + rx.remaining++; + rx.hdr_len++; break; #if defined(CONFIG_BT_CLASSIC) case BT_HCI_EVT_INQUIRY_RESULT_WITH_RSSI: case BT_HCI_EVT_EXTENDED_INQUIRY_RESULT: - h4->rx.discardable = true; + rx.discardable = true; break; #endif } } - if (!h4->rx.remaining) { - if (h4->rx.evt.evt == BT_HCI_EVT_LE_META_EVENT && - (h4->rx.hdr[sizeof(*hdr)] == BT_HCI_EVT_LE_ADVERTISING_REPORT)) { + if (!rx.remaining) { + if (rx.evt.evt == BT_HCI_EVT_LE_META_EVENT && + (rx.hdr[sizeof(*hdr)] == BT_HCI_EVT_LE_ADVERTISING_REPORT)) { LOG_DBG("Marking adv report as discardable"); - h4->rx.discardable = true; + rx.discardable = true; } - h4->rx.remaining = hdr->len - (h4->rx.hdr_len - sizeof(*hdr)); + rx.remaining = hdr->len - (rx.hdr_len - sizeof(*hdr)); LOG_DBG("Got event header. Payload %u bytes", hdr->len); - h4->rx.have_hdr = true; + rx.have_hdr = true; } } -static inline void copy_hdr(struct h4_data *h4) +static inline void copy_hdr(struct net_buf *buf) { - net_buf_add_mem(h4->rx.buf, h4->rx.hdr, h4->rx.hdr_len); + net_buf_add_mem(buf, rx.hdr, rx.hdr_len); } -static void reset_rx(struct h4_data *h4) +static void reset_rx(void) { - h4->rx.type = BT_HCI_H4_NONE; - h4->rx.remaining = 0U; - h4->rx.have_hdr = false; - h4->rx.hdr_len = 0U; - h4->rx.discardable = false; + rx.type = BT_HCI_H4_NONE; + rx.remaining = 0U; + rx.have_hdr = false; + rx.hdr_len = 0U; + rx.discardable = false; } -static struct net_buf *get_rx(struct h4_data *h4, k_timeout_t timeout) +static struct net_buf *get_rx(k_timeout_t timeout) { - LOG_DBG("type 0x%02x, evt 0x%02x", h4->rx.type, h4->rx.evt.evt); + LOG_DBG("type 0x%02x, evt 0x%02x", rx.type, rx.evt.evt); - switch (h4->rx.type) { + switch (rx.type) { case BT_HCI_H4_EVT: - return bt_buf_get_evt(h4->rx.evt.evt, h4->rx.discardable, timeout); + return bt_buf_get_evt(rx.evt.evt, rx.discardable, timeout); case BT_HCI_H4_ACL: return bt_buf_get_rx(BT_BUF_ACL_IN, timeout); case BT_HCI_H4_ISO: @@ -220,44 +205,42 @@ static struct net_buf *get_rx(struct h4_data *h4, k_timeout_t timeout) static void rx_thread(void *p1, void *p2, void *p3) { - const struct device *dev = p1; - const struct h4_config *cfg = dev->config; - struct h4_data *h4 = dev->data; struct net_buf *buf; + ARG_UNUSED(p1); ARG_UNUSED(p2); ARG_UNUSED(p3); LOG_DBG("started"); while (1) { - LOG_DBG("rx.buf %p", h4->rx.buf); + LOG_DBG("rx.buf %p", rx.buf); /* We can only do the allocation if we know the initial * header, since Command Complete/Status events must use the * original command buffer (if available). */ - if (h4->rx.have_hdr && !h4->rx.buf) { - h4->rx.buf = get_rx(h4, K_FOREVER); - LOG_DBG("Got rx.buf %p", h4->rx.buf); - if (h4->rx.remaining > net_buf_tailroom(h4->rx.buf)) { + if (rx.have_hdr && !rx.buf) { + rx.buf = get_rx(K_FOREVER); + LOG_DBG("Got rx.buf %p", rx.buf); + if (rx.remaining > net_buf_tailroom(rx.buf)) { LOG_ERR("Not enough space in buffer"); - h4->rx.discard = h4->rx.remaining; - reset_rx(h4); + rx.discard = rx.remaining; + reset_rx(); } else { - copy_hdr(h4); + copy_hdr(rx.buf); } } /* Let the ISR continue receiving new packets */ - uart_irq_rx_enable(cfg->uart); + uart_irq_rx_enable(h4_dev); - buf = net_buf_get(&h4->rx.fifo, K_FOREVER); + buf = net_buf_get(&rx.fifo, K_FOREVER); do { - uart_irq_rx_enable(cfg->uart); + uart_irq_rx_enable(h4_dev); LOG_DBG("Calling bt_recv(%p)", buf); - h4->recv(dev, buf); + bt_recv(buf); /* Give other threads a chance to run if the ISR * is receiving data so fast that rx.fifo never @@ -265,8 +248,8 @@ static void rx_thread(void *p1, void *p2, void *p3) */ k_yield(); - uart_irq_rx_disable(cfg->uart); - buf = net_buf_get(&h4->rx.fifo, K_NO_WAIT); + uart_irq_rx_disable(h4_dev); + buf = net_buf_get(&rx.fifo, K_NO_WAIT); } while (buf); } } @@ -285,93 +268,87 @@ static size_t h4_discard(const struct device *uart, size_t len) return err; } -static inline void read_payload(const struct device *dev) +static inline void read_payload(void) { - const struct h4_config *cfg = dev->config; - struct h4_data *h4 = dev->data; struct net_buf *buf; int read; - if (!h4->rx.buf) { + if (!rx.buf) { size_t buf_tailroom; - h4->rx.buf = get_rx(h4, K_NO_WAIT); - if (!h4->rx.buf) { - if (h4->rx.discardable) { - LOG_WRN("Discarding event 0x%02x", h4->rx.evt.evt); - h4->rx.discard = h4->rx.remaining; - reset_rx(h4); + rx.buf = get_rx(K_NO_WAIT); + if (!rx.buf) { + if (rx.discardable) { + LOG_WRN("Discarding event 0x%02x", rx.evt.evt); + rx.discard = rx.remaining; + reset_rx(); return; } LOG_WRN("Failed to allocate, deferring to rx_thread"); - uart_irq_rx_disable(cfg->uart); + uart_irq_rx_disable(h4_dev); return; } - LOG_DBG("Allocated rx.buf %p", h4->rx.buf); + LOG_DBG("Allocated rx.buf %p", rx.buf); - buf_tailroom = net_buf_tailroom(h4->rx.buf); - if (buf_tailroom < h4->rx.remaining) { - LOG_ERR("Not enough space in buffer %u/%zu", h4->rx.remaining, - buf_tailroom); - h4->rx.discard = h4->rx.remaining; - reset_rx(h4); + buf_tailroom = net_buf_tailroom(rx.buf); + if (buf_tailroom < rx.remaining) { + LOG_ERR("Not enough space in buffer %u/%zu", rx.remaining, buf_tailroom); + rx.discard = rx.remaining; + reset_rx(); return; } - copy_hdr(h4); + copy_hdr(rx.buf); } - read = uart_fifo_read(cfg->uart, net_buf_tail(h4->rx.buf), h4->rx.remaining); + read = uart_fifo_read(h4_dev, net_buf_tail(rx.buf), rx.remaining); if (unlikely(read < 0)) { LOG_ERR("Failed to read UART (err %d)", read); return; } - net_buf_add(h4->rx.buf, read); - h4->rx.remaining -= read; + net_buf_add(rx.buf, read); + rx.remaining -= read; - LOG_DBG("got %d bytes, remaining %u", read, h4->rx.remaining); - LOG_DBG("Payload (len %u): %s", h4->rx.buf->len, - bt_hex(h4->rx.buf->data, h4->rx.buf->len)); + LOG_DBG("got %d bytes, remaining %u", read, rx.remaining); + LOG_DBG("Payload (len %u): %s", rx.buf->len, bt_hex(rx.buf->data, rx.buf->len)); - if (h4->rx.remaining) { + if (rx.remaining) { return; } - buf = h4->rx.buf; - h4->rx.buf = NULL; + buf = rx.buf; + rx.buf = NULL; - if (h4->rx.type == BT_HCI_H4_EVT) { + if (rx.type == BT_HCI_H4_EVT) { bt_buf_set_type(buf, BT_BUF_EVT); } else { bt_buf_set_type(buf, BT_BUF_ACL_IN); } - reset_rx(h4); + reset_rx(); LOG_DBG("Putting buf %p to rx fifo", buf); - net_buf_put(&h4->rx.fifo, buf); + net_buf_put(&rx.fifo, buf); } -static inline void read_header(const struct device *dev) +static inline void read_header(void) { - struct h4_data *h4 = dev->data; - - switch (h4->rx.type) { + switch (rx.type) { case BT_HCI_H4_NONE: - h4_get_type(dev); + h4_get_type(); return; case BT_HCI_H4_EVT: - get_evt_hdr(dev); + get_evt_hdr(); break; case BT_HCI_H4_ACL: - get_acl_hdr(dev); + get_acl_hdr(); break; case BT_HCI_H4_ISO: if (IS_ENABLED(CONFIG_BT_ISO)) { - get_iso_hdr(dev); + get_iso_hdr(); break; } __fallthrough; @@ -380,43 +357,41 @@ static inline void read_header(const struct device *dev) return; } - if (h4->rx.have_hdr && h4->rx.buf) { - if (h4->rx.remaining > net_buf_tailroom(h4->rx.buf)) { + if (rx.have_hdr && rx.buf) { + if (rx.remaining > net_buf_tailroom(rx.buf)) { LOG_ERR("Not enough space in buffer"); - h4->rx.discard = h4->rx.remaining; - reset_rx(h4); + rx.discard = rx.remaining; + reset_rx(); } else { - copy_hdr(h4); + copy_hdr(rx.buf); } } } -static inline void process_tx(const struct device *dev) +static inline void process_tx(void) { - const struct h4_config *cfg = dev->config; - struct h4_data *h4 = dev->data; int bytes; - if (!h4->tx.buf) { - h4->tx.buf = net_buf_get(&h4->tx.fifo, K_NO_WAIT); - if (!h4->tx.buf) { + if (!tx.buf) { + tx.buf = net_buf_get(&tx.fifo, K_NO_WAIT); + if (!tx.buf) { LOG_ERR("TX interrupt but no pending buffer!"); - uart_irq_tx_disable(cfg->uart); + uart_irq_tx_disable(h4_dev); return; } } - if (!h4->tx.type) { - switch (bt_buf_get_type(h4->tx.buf)) { + if (!tx.type) { + switch (bt_buf_get_type(tx.buf)) { case BT_BUF_ACL_OUT: - h4->tx.type = BT_HCI_H4_ACL; + tx.type = BT_HCI_H4_ACL; break; case BT_BUF_CMD: - h4->tx.type = BT_HCI_H4_CMD; + tx.type = BT_HCI_H4_CMD; break; case BT_BUF_ISO_OUT: if (IS_ENABLED(CONFIG_BT_ISO)) { - h4->tx.type = BT_HCI_H4_ISO; + tx.type = BT_HCI_H4_ISO; break; } __fallthrough; @@ -425,79 +400,73 @@ static inline void process_tx(const struct device *dev) goto done; } - bytes = uart_fifo_fill(cfg->uart, &h4->tx.type, 1); + bytes = uart_fifo_fill(h4_dev, &tx.type, 1); if (bytes != 1) { LOG_WRN("Unable to send H:4 type"); - h4->tx.type = BT_HCI_H4_NONE; + tx.type = BT_HCI_H4_NONE; return; } } - bytes = uart_fifo_fill(cfg->uart, h4->tx.buf->data, h4->tx.buf->len); + bytes = uart_fifo_fill(h4_dev, tx.buf->data, tx.buf->len); if (unlikely(bytes < 0)) { LOG_ERR("Unable to write to UART (err %d)", bytes); } else { - net_buf_pull(h4->tx.buf, bytes); + net_buf_pull(tx.buf, bytes); } - if (h4->tx.buf->len) { + if (tx.buf->len) { return; } done: - h4->tx.type = BT_HCI_H4_NONE; - net_buf_unref(h4->tx.buf); - h4->tx.buf = net_buf_get(&h4->tx.fifo, K_NO_WAIT); - if (!h4->tx.buf) { - uart_irq_tx_disable(cfg->uart); + tx.type = BT_HCI_H4_NONE; + net_buf_unref(tx.buf); + tx.buf = net_buf_get(&tx.fifo, K_NO_WAIT); + if (!tx.buf) { + uart_irq_tx_disable(h4_dev); } } -static inline void process_rx(const struct device *dev) +static inline void process_rx(void) { - const struct h4_config *cfg = dev->config; - struct h4_data *h4 = dev->data; - - LOG_DBG("remaining %u discard %u have_hdr %u rx.buf %p len %u", - h4->rx.remaining, h4->rx.discard, h4->rx.have_hdr, h4->rx.buf, - h4->rx.buf ? h4->rx.buf->len : 0); + LOG_DBG("remaining %u discard %u have_hdr %u rx.buf %p len %u", rx.remaining, rx.discard, + rx.have_hdr, rx.buf, rx.buf ? rx.buf->len : 0); - if (h4->rx.discard) { - h4->rx.discard -= h4_discard(cfg->uart, h4->rx.discard); + if (rx.discard) { + rx.discard -= h4_discard(h4_dev, rx.discard); return; } - if (h4->rx.have_hdr) { - read_payload(dev); + if (rx.have_hdr) { + read_payload(); } else { - read_header(dev); + read_header(); } } -static void bt_uart_isr(const struct device *uart, void *user_data) +static void bt_uart_isr(const struct device *unused, void *user_data) { - struct device *dev = user_data; + ARG_UNUSED(unused); + ARG_UNUSED(user_data); - while (uart_irq_update(uart) && uart_irq_is_pending(uart)) { - if (uart_irq_tx_ready(uart)) { - process_tx(dev); + while (uart_irq_update(h4_dev) && uart_irq_is_pending(h4_dev)) { + if (uart_irq_tx_ready(h4_dev)) { + process_tx(); } - if (uart_irq_rx_ready(uart)) { - process_rx(dev); + if (uart_irq_rx_ready(h4_dev)) { + process_rx(); } } } -static int h4_send(const struct device *dev, struct net_buf *buf) +static int h4_send(struct net_buf *buf) { - const struct h4_config *cfg = dev->config; - struct h4_data *h4 = dev->data; - LOG_DBG("buf %p type %u len %u", buf, bt_buf_get_type(buf), buf->len); - net_buf_put(&h4->tx.fifo, buf); - uart_irq_tx_enable(cfg->uart); + net_buf_put(&tx.fifo, buf); + uart_irq_tx_enable(h4_dev); return 0; } @@ -508,36 +477,32 @@ static int h4_send(const struct device *dev, struct net_buf *buf) * * @return 0 on success, negative error value on failure */ -int __weak bt_hci_transport_setup(const struct device *uart) +int __weak bt_hci_transport_setup(const struct device *dev) { - h4_discard(uart, 32); + h4_discard(h4_dev, 32); return 0; } -static int h4_open(const struct device *dev, bt_hci_recv_t recv) +static int h4_open(void) { - const struct h4_config *cfg = dev->config; - struct h4_data *h4 = dev->data; int ret; k_tid_t tid; LOG_DBG(""); - uart_irq_rx_disable(cfg->uart); - uart_irq_tx_disable(cfg->uart); + uart_irq_rx_disable(h4_dev); + uart_irq_tx_disable(h4_dev); - ret = bt_hci_transport_setup(cfg->uart); + ret = bt_hci_transport_setup(h4_dev); if (ret < 0) { return -EIO; } - h4->recv = recv; - - uart_irq_callback_user_data_set(cfg->uart, bt_uart_isr, (void *)dev); + uart_irq_callback_set(h4_dev, bt_uart_isr); - tid = k_thread_create(cfg->rx_thread, cfg->rx_thread_stack, - cfg->rx_thread_stack_size, - rx_thread, (void *)dev, NULL, NULL, + tid = k_thread_create(&rx_thread_data, rx_thread_stack, + K_KERNEL_STACK_SIZEOF(rx_thread_stack), + rx_thread, NULL, NULL, NULL, K_PRIO_COOP(CONFIG_BT_RX_PRIO), 0, K_NO_WAIT); k_thread_name_set(tid, "bt_rx_thread"); @@ -546,10 +511,8 @@ static int h4_open(const struct device *dev, bt_hci_recv_t recv) } #if defined(CONFIG_BT_HCI_SETUP) -static int h4_setup(const struct device *dev, const struct bt_hci_setup_params *params) +static int h4_setup(const struct bt_hci_setup_params *params) { - const struct h4_config *cfg = dev->config; - ARG_UNUSED(params); /* Extern bt_h4_vnd_setup function. @@ -560,36 +523,30 @@ static int h4_setup(const struct device *dev, const struct bt_hci_setup_params * */ extern int bt_h4_vnd_setup(const struct device *dev); - return bt_h4_vnd_setup(cfg->uart); + return bt_h4_vnd_setup(h4_dev); } #endif -static const struct bt_hci_driver_api h4_driver_api = { - .open = h4_open, - .send = h4_send, +static const struct bt_hci_driver drv = { + .name = "H:4", + .bus = BT_HCI_DRIVER_BUS_UART, + .open = h4_open, + .send = h4_send, #if defined(CONFIG_BT_HCI_SETUP) - .setup = h4_setup, + .setup = h4_setup #endif }; -#define BT_UART_DEVICE_INIT(inst) \ - static K_KERNEL_STACK_DEFINE(rx_thread_stack_##inst, CONFIG_BT_DRV_RX_STACK_SIZE); \ - static struct k_thread rx_thread_##inst; \ - static const struct h4_config h4_config_##inst = { \ - .uart = DEVICE_DT_GET(DT_INST_PARENT(inst)), \ - .rx_thread_stack = rx_thread_stack_##inst, \ - .rx_thread_stack_size = K_KERNEL_STACK_SIZEOF(rx_thread_stack_##inst), \ - .rx_thread = &rx_thread_##inst, \ - }; \ - static struct h4_data h4_data_##inst = { \ - .rx = { \ - .fifo = Z_FIFO_INITIALIZER(h4_data_##inst.rx.fifo), \ - }, \ - .tx = { \ - .fifo = Z_FIFO_INITIALIZER(h4_data_##inst.tx.fifo), \ - }, \ - }; \ - DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &h4_data_##inst, &h4_config_##inst, \ - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &h4_driver_api) - -DT_INST_FOREACH_STATUS_OKAY(BT_UART_DEVICE_INIT) +static int bt_uart_init(void) +{ + + if (!device_is_ready(h4_dev)) { + return -ENODEV; + } + + bt_hci_driver_register(&drv); + + return 0; +} + +SYS_INIT(bt_uart_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/dts/bindings/bluetooth/zephyr,bt-hci-uart.yaml b/dts/bindings/bluetooth/zephyr,bt-hci-uart.yaml deleted file mode 100644 index d14f8e30356..00000000000 --- a/dts/bindings/bluetooth/zephyr,bt-hci-uart.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# UART Bluetooth HCI device - -description: Bluetooth HCI behind a UART device (H:4) - -compatible: "zephyr,bt-hci-uart" - -include: bt-hci.yaml - -properties: - bt-hci-name: - default: "H:4" - bt-hci-bus: - default: "BT_HCI_BUS_UART" diff --git a/tests/bsim/bluetooth/ll/conn/prj_split_hci_uart.conf b/tests/bsim/bluetooth/ll/conn/prj_split_hci_uart.conf index 4c39731af6a..58844e5a951 100644 --- a/tests/bsim/bluetooth/ll/conn/prj_split_hci_uart.conf +++ b/tests/bsim/bluetooth/ll/conn/prj_split_hci_uart.conf @@ -15,3 +15,4 @@ CONFIG_BT_L2CAP_TX_BUF_COUNT=6 CONFIG_BT_HCI=y CONFIG_BT_CTLR=n +CONFIG_BT_H4=y From 34367fd74d6774df327a00e2c6165741ac37b178 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 257/825] Revert "[nrf fromtree] Bluetooth: host: Add support for new-style HCI drivers" This reverts commit 639dbf3f88395a8aa43d7d4da669f0599de3bd69. --- include/zephyr/drivers/bluetooth/hci_driver.h | 2 + subsys/bluetooth/host/hci_core.c | 127 ++++-------------- subsys/bluetooth/host/hci_core.h | 10 -- subsys/bluetooth/host/hci_ecc.c | 21 --- subsys/bluetooth/host/hci_raw.c | 47 +------ subsys/bluetooth/host/hci_raw_internal.h | 11 -- 6 files changed, 30 insertions(+), 188 deletions(-) diff --git a/include/zephyr/drivers/bluetooth/hci_driver.h b/include/zephyr/drivers/bluetooth/hci_driver.h index 0aaf7bac583..08aacc853f3 100644 --- a/include/zephyr/drivers/bluetooth/hci_driver.h +++ b/include/zephyr/drivers/bluetooth/hci_driver.h @@ -37,6 +37,8 @@ enum { BT_QUIRK_NO_AUTO_DLE = BIT(1), }; +#define IS_BT_QUIRK_NO_AUTO_DLE(bt_dev) ((bt_dev)->drv->quirks & BT_QUIRK_NO_AUTO_DLE) + /** * @brief Receive data from the controller/HCI driver. * diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 67511d1642b..860019da82d 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -27,11 +27,7 @@ #include #include #include -#if DT_HAS_CHOSEN(zephyr_bt_hci) -#include -#else #include -#endif #include "common/bt_str.h" #include "common/assert.h" @@ -67,10 +63,6 @@ #include LOG_MODULE_REGISTER(bt_hci_core); -#define BT_HCI_DEV DT_CHOSEN(zephyr_bt_hci) -#define BT_HCI_BUS BT_DT_HCI_BUS_GET(BT_HCI_DEV) -#define BT_HCI_NAME BT_DT_HCI_NAME_GET(BT_HCI_DEV) - #define HCI_CMD_TIMEOUT K_SECONDS(10) /* Stacks for the threads */ @@ -93,9 +85,6 @@ struct bt_dev bt_dev = { #if defined(CONFIG_BT_DEVICE_APPEARANCE_DYNAMIC) .appearance = CONFIG_BT_DEVICE_APPEARANCE, #endif -#if DT_HAS_CHOSEN(zephyr_bt_hci) - .hci = DEVICE_DT_GET(BT_HCI_DEV), -#endif }; static bt_ready_cb_t ready_cb; @@ -123,28 +112,6 @@ static struct cmd_data cmd_data[CONFIG_BT_BUF_CMD_TX_COUNT]; #define cmd(buf) (&cmd_data[net_buf_id(buf)]) #define acl(buf) ((struct acl_data *)net_buf_user_data(buf)) -#if DT_HAS_CHOSEN(zephyr_bt_hci) -static bool drv_quirk_no_reset(void) -{ - return ((BT_DT_HCI_QUIRKS_GET(DT_CHOSEN(zephyr_bt_hci)) & BT_HCI_QUIRK_NO_RESET) != 0); -} - -__maybe_unused static bool drv_quirk_no_auto_dle(void) -{ - return ((BT_DT_HCI_QUIRKS_GET(DT_CHOSEN(zephyr_bt_hci)) & BT_HCI_QUIRK_NO_AUTO_DLE) != 0); -} -#else -static bool drv_quirk_no_reset(void) -{ - return ((bt_dev.drv->quirks & BT_QUIRK_NO_RESET) != 0); -} - -__maybe_unused static bool drv_quirk_no_auto_dle(void) -{ - return ((bt_dev.drv->quirks & BT_QUIRK_NO_AUTO_DLE) != 0); -} -#endif - void bt_hci_cmd_state_set_init(struct net_buf *buf, struct bt_hci_cmd_state_set *state, atomic_t *target, int bit, bool val) @@ -1188,7 +1155,7 @@ static void conn_auto_initiate(struct bt_conn *conn) if (IS_ENABLED(CONFIG_BT_AUTO_DATA_LEN_UPDATE) && BT_FEAT_LE_DLE(bt_dev.le.features)) { - if (drv_quirk_no_auto_dle()) { + if (IS_BT_QUIRK_NO_AUTO_DLE(&bt_dev)) { uint16_t tx_octets, tx_time; err = hci_le_read_max_data_len(&tx_octets, &tx_time); @@ -3229,7 +3196,7 @@ static int common_init(void) struct net_buf *rsp; int err; - if (!drv_quirk_no_reset()) { + if (!(bt_dev.drv->quirks & BT_QUIRK_NO_RESET)) { /* Send HCI_RESET */ err = bt_hci_cmd_send_sync(BT_HCI_OP_RESET, NULL, &rsp); if (err) { @@ -3933,19 +3900,12 @@ static int hci_init(void) } #endif /* defined(CONFIG_BT_HCI_SET_PUBLIC_ADDR) */ -#if DT_HAS_CHOSEN(zephyr_bt_hci) - err = bt_hci_setup(bt_dev.hci, &setup_params); - if (err && err != -ENOSYS) { - return err; - } -#else if (bt_dev.drv->setup) { err = bt_dev.drv->setup(&setup_params); if (err) { return err; } } -#endif #endif /* defined(CONFIG_BT_HCI_SETUP) */ err = common_init(); @@ -4000,11 +3960,7 @@ int bt_send(struct net_buf *buf) return bt_hci_ecc_send(buf); } -#if DT_HAS_CHOSEN(zephyr_bt_hci) - return bt_hci_send(bt_dev.hci, buf); -#else return bt_dev.drv->send(buf); -#endif } static const struct event_handler prio_events[] = { @@ -4106,14 +4062,8 @@ static int bt_recv_unsafe(struct net_buf *buf) } } -#if DT_HAS_CHOSEN(zephyr_bt_hci) -int bt_hci_recv(const struct device *dev, struct net_buf *buf) -{ - ARG_UNUSED(dev); -#else int bt_recv(struct net_buf *buf) { -#endif int err; k_sched_lock(); @@ -4123,8 +4073,6 @@ int bt_recv(struct net_buf *buf) return err; } -/* Old-style HCI driver registration */ -#if !DT_HAS_CHOSEN(zephyr_bt_hci) int bt_hci_driver_register(const struct bt_hci_driver *drv) { if (bt_dev.drv) { @@ -4144,7 +4092,6 @@ int bt_hci_driver_register(const struct bt_hci_driver *drv) return 0; } -#endif /* !DT_HAS_CHOSEN(zephyr_bt_hci) */ void bt_finalize_init(void) { @@ -4266,19 +4213,10 @@ int bt_enable(bt_ready_cb_t cb) { int err; -#if DT_HAS_CHOSEN(zephyr_bt_hci) - if (!device_is_ready(bt_dev.hci)) { - LOG_ERR("HCI driver is not ready"); - return -ENODEV; - } - - bt_monitor_new_index(BT_MONITOR_TYPE_PRIMARY, BT_HCI_BUS, BT_ADDR_ANY, BT_HCI_NAME); -#else /* !DT_HAS_CHONSEN(zephyr_bt_hci) */ if (!bt_dev.drv) { LOG_ERR("No HCI driver registered"); return -ENODEV; } -#endif atomic_clear_bit(bt_dev.flags, BT_DEV_DISABLE); @@ -4327,11 +4265,7 @@ int bt_enable(bt_ready_cb_t cb) k_thread_name_set(&bt_workq.thread, "BT RX WQ"); #endif -#if DT_HAS_CHOSEN(zephyr_bt_hci) - err = bt_hci_open(bt_dev.hci, bt_hci_recv); -#else err = bt_dev.drv->open(); -#endif if (err) { LOG_ERR("HCI driver open failed (%d)", err); return err; @@ -4351,7 +4285,6 @@ int bt_disable(void) { int err; -#if !DT_HAS_CHOSEN(zephyr_bt_hci) if (!bt_dev.drv) { LOG_ERR("No HCI driver registered"); return -ENODEV; @@ -4360,7 +4293,6 @@ int bt_disable(void) if (!bt_dev.drv->close) { return -ENOTSUP; } -#endif if (atomic_test_and_set_bit(bt_dev.flags, BT_DEV_DISABLE)) { return -EALREADY; @@ -4369,6 +4301,29 @@ int bt_disable(void) /* Clear BT_DEV_READY before disabling HCI link */ atomic_clear_bit(bt_dev.flags, BT_DEV_READY); + err = bt_dev.drv->close(); + if (err) { + LOG_ERR("HCI driver close failed (%d)", err); + + /* Re-enable BT_DEV_READY to avoid inconsistent stack state */ + atomic_set_bit(bt_dev.flags, BT_DEV_READY); + + return err; + } + + /* Some functions rely on checking this bitfield */ + memset(bt_dev.supported_commands, 0x00, sizeof(bt_dev.supported_commands)); + + /* Reset IDs and corresponding keys. */ + bt_dev.id_count = 0; +#if defined(CONFIG_BT_SMP) + bt_dev.le.rl_entries = 0; + bt_keys_reset(); +#endif + + /* If random address was set up - clear it */ + bt_addr_le_copy(&bt_dev.random_addr, BT_ADDR_LE_ANY); + #if defined(CONFIG_BT_BROADCASTER) bt_adv_reset_adv_pool(); #endif /* CONFIG_BT_BROADCASTER */ @@ -4397,38 +4352,6 @@ int bt_disable(void) k_thread_abort(&bt_workq.thread); #endif -#if DT_HAS_CHOSEN(zephyr_bt_hci) - err = bt_hci_close(bt_dev.hci); - if (err == -ENOSYS) { - atomic_clear_bit(bt_dev.flags, BT_DEV_DISABLE); - atomic_set_bit(bt_dev.flags, BT_DEV_READY); - return -ENOTSUP; - } -#else - err = bt_dev.drv->close(); -#endif - if (err) { - LOG_ERR("HCI driver close failed (%d)", err); - - /* Re-enable BT_DEV_READY to avoid inconsistent stack state */ - atomic_set_bit(bt_dev.flags, BT_DEV_READY); - - return err; - } - - /* Some functions rely on checking this bitfield */ - memset(bt_dev.supported_commands, 0x00, sizeof(bt_dev.supported_commands)); - - /* Reset IDs and corresponding keys. */ - bt_dev.id_count = 0; -#if defined(CONFIG_BT_SMP) - bt_dev.le.rl_entries = 0; - bt_keys_reset(); -#endif - - /* If random address was set up - clear it */ - bt_addr_le_copy(&bt_dev.random_addr, BT_ADDR_LE_ANY); - if (IS_ENABLED(CONFIG_BT_ISO)) { bt_iso_reset(); } diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index 52387fa5712..52680574453 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -7,8 +7,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - /* LL connection parameters */ #define LE_CONN_LATENCY 0x0000 #define LE_CONN_TIMEOUT 0x002a @@ -396,12 +394,8 @@ struct bt_dev { /* Queue for outgoing HCI commands */ struct k_fifo cmd_tx_queue; -#if DT_HAS_CHOSEN(zephyr_bt_hci) - const struct device *hci; -#else /* Registered HCI driver */ const struct bt_hci_driver *drv; -#endif #if defined(CONFIG_BT_PRIVACY) /* Local Identity Resolving Key */ @@ -436,10 +430,6 @@ extern sys_slist_t bt_auth_info_cbs; enum bt_security_err bt_security_err_get(uint8_t hci_err); #endif /* CONFIG_BT_SMP || CONFIG_BT_CLASSIC */ -#if DT_HAS_CHOSEN(zephyr_bt_hci) -int bt_hci_recv(const struct device *dev, struct net_buf *buf); -#endif - /* Data type to store state related with command to be updated * when command completes successfully. */ diff --git a/subsys/bluetooth/host/hci_ecc.c b/subsys/bluetooth/host/hci_ecc.c index 718d90176fa..8c1b1a777b9 100644 --- a/subsys/bluetooth/host/hci_ecc.c +++ b/subsys/bluetooth/host/hci_ecc.c @@ -19,14 +19,9 @@ #include #include -#include #include #include -#if DT_HAS_CHOSEN(zephyr_bt_hci) -#include -#else #include -#endif #include "common/bt_str.h" @@ -97,11 +92,7 @@ static void send_cmd_status(uint16_t opcode, uint8_t status) evt->opcode = sys_cpu_to_le16(opcode); evt->status = status; -#if DT_HAS_CHOSEN(zephyr_bt_hci) - bt_hci_recv(bt_dev.hci, buf); -#else bt_recv(buf); -#endif } static uint8_t generate_keys(void) @@ -163,11 +154,7 @@ static void emulate_le_p256_public_key_cmd(void) atomic_clear_bit(flags, PENDING_PUB_KEY); -#if DT_HAS_CHOSEN(zephyr_bt_hci) - bt_hci_recv(bt_dev.hci, buf); -#else bt_recv(buf); -#endif } static void emulate_le_generate_dhkey(void) @@ -215,11 +202,7 @@ static void emulate_le_generate_dhkey(void) atomic_clear_bit(flags, PENDING_DHKEY); -#if DT_HAS_CHOSEN(zephyr_bt_hci) - bt_hci_recv(bt_dev.hci, buf); -#else bt_recv(buf); -#endif } static void ecc_process(struct k_work *work) @@ -344,11 +327,7 @@ int bt_hci_ecc_send(struct net_buf *buf) } } -#if DT_HAS_CHOSEN(zephyr_bt_hci) - return bt_hci_send(bt_dev.hci, buf); -#else return bt_dev.drv->send(buf); -#endif } void bt_hci_ecc_supported_commands(uint8_t *supported_commands) diff --git a/subsys/bluetooth/host/hci_raw.c b/subsys/bluetooth/host/hci_raw.c index 227aff84ac9..2aa8a4fe3d1 100644 --- a/subsys/bluetooth/host/hci_raw.c +++ b/subsys/bluetooth/host/hci_raw.c @@ -9,13 +9,8 @@ #include #include #include -#include -#if DT_HAS_CHOSEN(zephyr_bt_hci) -#include -#else #include -#endif #include #include #include @@ -59,19 +54,10 @@ NET_BUF_POOL_FIXED_DEFINE(hci_iso_pool, CONFIG_BT_ISO_TX_BUF_COUNT, sizeof(struct bt_buf_data), NULL); #endif /* CONFIG_BT_ISO */ -#define BT_HCI_DEV DT_CHOSEN(zephyr_bt_hci) -#define BT_HCI_BUS BT_DT_HCI_BUS_GET(BT_HCI_DEV) -#define BT_HCI_NAME BT_DT_HCI_NAME_GET(BT_HCI_DEV) - -struct bt_dev_raw bt_dev = { -#if DT_HAS_CHOSEN(zephyr_bt_hci) - .hci = DEVICE_DT_GET(BT_HCI_DEV), -#endif -}; +struct bt_dev_raw bt_dev; struct bt_hci_raw_cmd_ext *cmd_ext; static size_t cmd_ext_size; -#if !DT_HAS_CHOSEN(zephyr_bt_hci) int bt_hci_driver_register(const struct bt_hci_driver *drv) { if (bt_dev.drv) { @@ -91,7 +77,6 @@ int bt_hci_driver_register(const struct bt_hci_driver *drv) return 0; } -#endif struct net_buf *bt_buf_get_rx(enum bt_buf_type type, k_timeout_t timeout) { @@ -197,14 +182,8 @@ struct net_buf *bt_buf_get_evt(uint8_t evt, bool discardable, k_timeout_t timeou return bt_buf_get_rx(BT_BUF_EVT, timeout); } -#if DT_HAS_CHOSEN(zephyr_bt_hci) -int bt_hci_recv(const struct device *dev, struct net_buf *buf) -{ - ARG_UNUSED(dev); -#else int bt_recv(struct net_buf *buf) { -#endif LOG_DBG("buf %p len %u", buf, buf->len); bt_monitor_send(bt_monitor_opcode(buf), buf->data, buf->len); @@ -249,11 +228,7 @@ static void bt_cmd_complete_ext(uint16_t op, uint8_t status) cc = net_buf_add(buf, sizeof(*cc)); cc->status = status; -#if DT_HAS_CHOSEN(zephyr_bt_hci) - bt_hci_recv(bt_dev.hci, buf); -#else bt_recv(buf); -#endif } static uint8_t bt_send_ext(struct net_buf *buf) @@ -333,11 +308,7 @@ int bt_send(struct net_buf *buf) return bt_hci_ecc_send(buf); } -#if DT_HAS_CHOSEN(zephyr_bt_hci) - return bt_hci_send(bt_dev.hci, buf); -#else return bt_dev.drv->send(buf); -#endif } int bt_hci_raw_set_mode(uint8_t mode) @@ -375,31 +346,19 @@ void bt_hci_raw_cmd_ext_register(struct bt_hci_raw_cmd_ext *cmds, size_t size) int bt_enable_raw(struct k_fifo *rx_queue) { + const struct bt_hci_driver *drv = bt_dev.drv; int err; LOG_DBG(""); raw_rx = rx_queue; -#if DT_HAS_CHOSEN(zephyr_bt_hci) - if (!device_is_ready(bt_dev.hci)) { - LOG_ERR("HCI driver is not ready"); - return -ENODEV; - } - - bt_monitor_new_index(BT_MONITOR_TYPE_PRIMARY, BT_HCI_BUS, BT_ADDR_ANY, BT_HCI_NAME); - - err = bt_hci_open(bt_dev.hci, bt_hci_recv); -#else - const struct bt_hci_driver *drv = bt_dev.drv; - - if (!drv) { + if (!bt_dev.drv) { LOG_ERR("No HCI driver registered"); return -ENODEV; } err = drv->open(); -#endif if (err) { LOG_ERR("HCI driver open failed (%d)", err); return err; diff --git a/subsys/bluetooth/host/hci_raw_internal.h b/subsys/bluetooth/host/hci_raw_internal.h index af09144f785..9539cc10350 100644 --- a/subsys/bluetooth/host/hci_raw_internal.h +++ b/subsys/bluetooth/host/hci_raw_internal.h @@ -6,26 +6,15 @@ #ifndef __BT_HCI_RAW_INTERNAL_H #define __BT_HCI_RAW_INTERNAL_H -#include -#include - #ifdef __cplusplus extern "C" { #endif struct bt_dev_raw { -#if DT_HAS_CHOSEN(zephyr_bt_hci) - const struct device *hci; -#else /* Registered HCI driver */ const struct bt_hci_driver *drv; -#endif }; -#if DT_HAS_CHOSEN(zephyr_bt_hci) -int bt_hci_recv(const struct device *dev, struct net_buf *buf); -#endif - extern struct bt_dev_raw bt_dev; #ifdef __cplusplus From 2c200eb55d52645262311e72ce4f1843ba004f74 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 258/825] Revert "[nrf fromtree] Bluetooth: include: Add initial HCI driver API definition" This reverts commit 8c6f5c4b59dfedfd1af398b5ef5ee2ff9db76b37. --- include/zephyr/drivers/bluetooth.h | 257 ----------------------------- 1 file changed, 257 deletions(-) delete mode 100644 include/zephyr/drivers/bluetooth.h diff --git a/include/zephyr/drivers/bluetooth.h b/include/zephyr/drivers/bluetooth.h deleted file mode 100644 index f447c76b792..00000000000 --- a/include/zephyr/drivers/bluetooth.h +++ /dev/null @@ -1,257 +0,0 @@ -/** @file - * @brief Bluetooth HCI driver API. - * - * Copyright (c) 2024 Johan Hedberg - * - * SPDX-License-Identifier: Apache-2.0 - */ -#ifndef ZEPHYR_INCLUDE_DRIVERS_BLUETOOTH_H_ -#define ZEPHYR_INCLUDE_DRIVERS_BLUETOOTH_H_ - -/** - * @brief Bluetooth HCI APIs - * @defgroup bt_hci_api Bluetooth HCI APIs - * @ingroup bluetooth - * @{ - */ - -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct bt_hci_setup_params { - /** The public identity address to give to the controller. This field is used when the - * driver selects @kconfig{CONFIG_BT_HCI_SET_PUBLIC_ADDR} to indicate that it supports - * setting the controller's public address. - */ - bt_addr_t public_addr; -}; - -enum { - /* The host should never send HCI_Reset */ - BT_HCI_QUIRK_NO_RESET = BIT(0), - /* The controller does not auto-initiate a DLE procedure when the - * initial connection data length parameters are not equal to the - * default data length parameters. Therefore the host should initiate - * the DLE procedure after connection establishment. - */ - BT_HCI_QUIRK_NO_AUTO_DLE = BIT(1), -}; - -/** Possible values for the 'bus' member of the bt_hci_driver struct */ -enum bt_hci_bus { - BT_HCI_BUS_VIRTUAL = 0, - BT_HCI_BUS_USB = 1, - BT_HCI_BUS_PCCARD = 2, - BT_HCI_BUS_UART = 3, - BT_HCI_BUS_RS232 = 4, - BT_HCI_BUS_PCI = 5, - BT_HCI_BUS_SDIO = 6, - BT_HCI_BUS_SPI = 7, - BT_HCI_BUS_I2C = 8, - BT_HCI_BUS_IPM = 9, -}; - -#define BT_DT_HCI_QUIRK_OR(node_id, prop, idx) DT_STRING_TOKEN_BY_IDX(node_id, prop, idx) -#define BT_DT_HCI_QUIRKS_GET(node_id) COND_CODE_1(DT_NODE_HAS_PROP(node_id, bt_hci_quirks), \ - (DT_FOREACH_PROP_ELEM_SEP(node_id, \ - bt_hci_quirks, \ - BT_DT_HCI_QUIRK_OR, \ - (|))), \ - (0)) -#define BT_DT_HCI_QUIRKS_INST_GET(inst) BT_DT_HCI_QUIRKS_GET(DT_DRV_INST(inst)) - -#define BT_DT_HCI_NAME_GET(node_id) DT_PROP_OR(node_id, bt_hci_name, "HCI") -#define BT_DT_HCI_NAME_INST_GET(inst) BT_DT_HCI_NAME_GET(DT_DRV_INST(inst)) - -#define BT_DT_HCI_BUS_GET(node_id) DT_STRING_TOKEN_OR(node_id, bt_hci_bus, BT_HCI_BUS_VIRTUAL) -#define BT_DT_HCI_BUS_INST_GET(inst) BT_DT_HCI_BUS_GET(DT_DRV_INST(inst)) - -typedef int (*bt_hci_recv_t)(const struct device *dev, struct net_buf *buf); - -__subsystem struct bt_hci_driver_api { - int (*open)(const struct device *dev, bt_hci_recv_t recv); - int (*close)(const struct device *dev); - int (*send)(const struct device *dev, struct net_buf *buf); -#if defined(CONFIG_BT_HCI_SETUP) - int (*setup)(const struct device *dev, - const struct bt_hci_setup_params *param); -#endif /* defined(CONFIG_BT_HCI_SETUP) */ -}; - -/** - * @brief Open the HCI transport. - * - * Opens the HCI transport for operation. This function must not - * return until the transport is ready for operation, meaning it - * is safe to start calling the send() handler. - * - * @param dev HCI device - * @param recv This is callback through which the HCI driver provides the - * host with data from the controller. The buffer passed to - * the callback will have its type set with bt_buf_set_type(). - * The callback is expected to be called from thread context. - * - * @return 0 on success or negative POSIX error number on failure. - */ -static inline int bt_hci_open(const struct device *dev, bt_hci_recv_t recv) -{ - const struct bt_hci_driver_api *api = (const struct bt_hci_driver_api *)dev->api; - - return api->open(dev, recv); -} - -/** - * @brief Close the HCI transport. - * - * Closes the HCI transport. This function must not return until the - * transport is closed. - * - * @param dev HCI device - * - * @return 0 on success or negative POSIX error number on failure. - */ -static inline int bt_hci_close(const struct device *dev) -{ - const struct bt_hci_driver_api *api = (const struct bt_hci_driver_api *)dev->api; - - if (api->close == NULL) { - return -ENOSYS; - } - - return api->close(dev); -} - -/** - * @brief Send HCI buffer to controller. - * - * Send an HCI packet to the controller. The packet type of the buffer - * must be set using bt_buf_set_type(). - * - * @note This function must only be called from a cooperative thread. - * - * @param dev HCI device - * @param buf Buffer containing data to be sent to the controller. - * - * @return 0 on success or negative POSIX error number on failure. - */ -static inline int bt_hci_send(const struct device *dev, struct net_buf *buf) -{ - const struct bt_hci_driver_api *api = (const struct bt_hci_driver_api *)dev->api; - - return api->send(dev, buf); -} - -#if defined(CONFIG_BT_HCI_SETUP) || defined(__DOXYGEN__) -/** - * @brief HCI vendor-specific setup - * - * Executes vendor-specific commands sequence to initialize - * BT Controller before BT Host executes Reset sequence. This is normally - * called directly after bt_hci_open(). - * - * @note @kconfig{CONFIG_BT_HCI_SETUP} must be selected for this - * field to be available. - * - * @return 0 on success or negative POSIX error number on failure. - */ -static inline int bt_hci_setup(const struct device *dev, struct bt_hci_setup_params *params) -{ - const struct bt_hci_driver_api *api = (const struct bt_hci_driver_api *)dev->api; - - if (api->setup == NULL) { - return -ENOSYS; - } - - return api->setup(dev, params); -} -#endif - -/** - * @} - */ - -/* The following functions are not strictly part of the HCI driver API, in that - * they do not take as input a struct device which implements the HCI driver API. - */ - -/** - * @brief Setup the HCI transport, which usually means to reset the - * Bluetooth IC. - * - * @note A weak version of this function is included in the H4 driver, so - * defining it is optional per board. - * - * @param dev The device structure for the bus connecting to the IC - * - * @return 0 on success, negative error value on failure - */ -int bt_hci_transport_setup(const struct device *dev); - -/** - * @brief Teardown the HCI transport. - * - * @note A weak version of this function is included in the IPC driver, so - * defining it is optional. NRF5340 includes support to put network core - * in reset state. - * - * @param dev The device structure for the bus connecting to the IC - * - * @return 0 on success, negative error value on faulure - */ -int bt_hci_transport_teardown(const struct device *dev); - -/** Allocate an HCI event buffer. - * - * This function allocates a new buffer for an HCI event. It is given the - * event code and the total length of the parameters. Upon successful return - * the buffer is ready to have the parameters encoded into it. - * - * @param evt HCI event OpCode. - * @param len Length of event parameters. - * - * @return Newly allocated buffer. - */ -struct net_buf *bt_hci_evt_create(uint8_t evt, uint8_t len); - -/** Allocate an HCI Command Complete event buffer. - * - * This function allocates a new buffer for HCI Command Complete event. - * It is given the OpCode (encoded e.g. using the BT_OP macro) and the total - * length of the parameters. Upon successful return the buffer is ready to have - * the parameters encoded into it. - * - * @param op HCI command OpCode. - * @param plen Length of command parameters. - * - * @return Newly allocated buffer. - */ -struct net_buf *bt_hci_cmd_complete_create(uint16_t op, uint8_t plen); - -/** Allocate an HCI Command Status event buffer. - * - * This function allocates a new buffer for HCI Command Status event. - * It is given the OpCode (encoded e.g. using the BT_OP macro) and the status - * code. Upon successful return the buffer is ready to have the parameters - * encoded into it. - * - * @param op HCI command OpCode. - * @param status Status code. - * - * @return Newly allocated buffer. - */ -struct net_buf *bt_hci_cmd_status_create(uint16_t op, uint8_t status); - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_INCLUDE_DRIVERS_BLUETOOTH_H_ */ From cb35e0e5b969bfe2696a509b54dd7c6881e7a30a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:03 +0200 Subject: [PATCH 259/825] Revert "[nrf fromtree] Bluetooth: Add devicetree base binding for Bluetooth HCI drivers" This reverts commit e089fbb32705c5c7d9bce722592d71fe78adbd81. --- dts/bindings/bluetooth/bt-hci.yaml | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 dts/bindings/bluetooth/bt-hci.yaml diff --git a/dts/bindings/bluetooth/bt-hci.yaml b/dts/bindings/bluetooth/bt-hci.yaml deleted file mode 100644 index d87a31ddacd..00000000000 --- a/dts/bindings/bluetooth/bt-hci.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# Common fields for Bluetooth HCI devices - -include: base.yaml - -properties: - bt-hci-name: - type: string - description: Name of the HCI transport - bt-hci-bus: - type: string - description: Bus of the transport - enum: - - "BT_HCI_BUS_VIRTUAL" - - "BT_HCI_BUS_USB" - - "BT_HCI_BUS_PCCARD" - - "BT_HCI_BUS_UART" - - "BT_HCI_BUS_RS232" - - "BT_HCI_BUS_PCI" - - "BT_HCI_BUS_SDIO" - - "BT_HCI_BUS_SPI" - - "BT_HCI_BUS_I2C" - - "BT_HCI_BUS_IPM" - bt-hci-quirks: - type: string-array - description: HCI device quirks From f82ce799b624c45dd7c422e64ea1d600692d5c36 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 260/825] Revert "[nrf fromtree] Bluetooth: drivers: Remove unmaintained B91 HCI driver" This reverts commit 27ffbb71a63f517a3ad367e654eaaabca3a08292. --- .../telink/tlsr9518adk80d/Kconfig.defconfig | 16 ++ drivers/bluetooth/hci/CMakeLists.txt | 1 + drivers/bluetooth/hci/Kconfig | 5 + drivers/bluetooth/hci/hci_b91.c | 248 ++++++++++++++++++ subsys/bluetooth/host/Kconfig | 1 + west.yml | 2 +- 6 files changed, 272 insertions(+), 1 deletion(-) create mode 100644 drivers/bluetooth/hci/hci_b91.c diff --git a/boards/telink/tlsr9518adk80d/Kconfig.defconfig b/boards/telink/tlsr9518adk80d/Kconfig.defconfig index a1dc3d5f582..001ad287586 100644 --- a/boards/telink/tlsr9518adk80d/Kconfig.defconfig +++ b/boards/telink/tlsr9518adk80d/Kconfig.defconfig @@ -6,6 +6,22 @@ if BOARD_TLSR9518ADK80D config SOC_FLASH_TELINK_B91 default y if FLASH +if BT + +# BLE Controller SDK from hal_telink requires +# Telink's toolchain with FPU support +config FPU + default y if "$(ZEPHYR_TOOLCHAIN_VARIANT)" != "zephyr" + +config BT_HCI_ACL_FLOW_CONTROL + default n + +choice BT_HCI_BUS_TYPE + default BT_B91 +endchoice + +endif # BT + # Workaround for not being able to have commas in macro arguments DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition diff --git a/drivers/bluetooth/hci/CMakeLists.txt b/drivers/bluetooth/hci/CMakeLists.txt index 6070ffd40b9..ab1df047ce1 100644 --- a/drivers/bluetooth/hci/CMakeLists.txt +++ b/drivers/bluetooth/hci/CMakeLists.txt @@ -13,6 +13,7 @@ if(CONFIG_BT_HCI_IPC) endif() endif() +zephyr_library_sources_ifdef(CONFIG_BT_B91 hci_b91.c) zephyr_library_sources_ifdef(CONFIG_BT_AIROC cyw43xxx.c) zephyr_library_sources_ifdef(CONFIG_BT_ESP32 hci_esp32.c) zephyr_library_sources_ifdef(CONFIG_BT_H4 h4.c) diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index ba117d695c0..1b4bc9fdb25 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -97,6 +97,11 @@ config BT_ESP32 help Espressif HCI bluetooth interface +config BT_B91 + bool "Telink B91 HCI driver" + help + Telink B91 HCI bluetooth interface + config BT_PSOC6_BLESS bool "PSOC6 BLESS driver" select BT_HCI_SETUP diff --git a/drivers/bluetooth/hci/hci_b91.c b/drivers/bluetooth/hci/hci_b91.c new file mode 100644 index 00000000000..9909718e94b --- /dev/null +++ b/drivers/bluetooth/hci/hci_b91.c @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2022, Telink Semiconductor (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +#include +#include + +#include + +#define LOG_LEVEL CONFIG_BT_HCI_DRIVER_LOG_LEVEL +#include +LOG_MODULE_REGISTER(bt_hci_driver_b91); + +#define HCI_BT_B91_TIMEOUT K_MSEC(2000) + +static K_SEM_DEFINE(hci_send_sem, 1, 1); + +static bool is_hci_event_discardable(const uint8_t *evt_data) +{ + uint8_t evt_type = evt_data[0]; + + switch (evt_type) { +#if defined(CONFIG_BT_CLASSIC) + case BT_HCI_EVT_INQUIRY_RESULT_WITH_RSSI: + case BT_HCI_EVT_EXTENDED_INQUIRY_RESULT: + return true; +#endif + case BT_HCI_EVT_LE_META_EVENT: { + uint8_t subevt_type = evt_data[sizeof(struct bt_hci_evt_hdr)]; + + switch (subevt_type) { + case BT_HCI_EVT_LE_ADVERTISING_REPORT: + return true; + default: + return false; + } + } + default: + return false; + } +} + +static struct net_buf *bt_b91_evt_recv(uint8_t *data, size_t len) +{ + bool discardable; + struct bt_hci_evt_hdr hdr; + struct net_buf *buf; + size_t buf_tailroom; + + if (len < sizeof(hdr)) { + LOG_ERR("Not enough data for event header"); + return NULL; + } + + discardable = is_hci_event_discardable(data); + + memcpy((void *)&hdr, data, sizeof(hdr)); + data += sizeof(hdr); + len -= sizeof(hdr); + + if (len != hdr.len) { + LOG_ERR("Event payload length is not correct"); + return NULL; + } + LOG_DBG("len %u", hdr.len); + + buf = bt_buf_get_evt(hdr.evt, discardable, K_NO_WAIT); + if (!buf) { + if (discardable) { + LOG_DBG("Discardable buffer pool full, ignoring event"); + } else { + LOG_ERR("No available event buffers!"); + } + return buf; + } + + net_buf_add_mem(buf, &hdr, sizeof(hdr)); + + buf_tailroom = net_buf_tailroom(buf); + if (buf_tailroom < len) { + LOG_ERR("Not enough space in buffer %zu/%zu", len, buf_tailroom); + net_buf_unref(buf); + return NULL; + } + + net_buf_add_mem(buf, data, len); + + return buf; +} + +static struct net_buf *bt_b91_acl_recv(uint8_t *data, size_t len) +{ + struct bt_hci_acl_hdr hdr; + struct net_buf *buf; + size_t buf_tailroom; + + if (len < sizeof(hdr)) { + LOG_ERR("Not enough data for ACL header"); + return NULL; + } + + buf = bt_buf_get_rx(BT_BUF_ACL_IN, K_NO_WAIT); + if (buf) { + memcpy((void *)&hdr, data, sizeof(hdr)); + data += sizeof(hdr); + len -= sizeof(hdr); + } else { + LOG_ERR("No available ACL buffers!"); + return NULL; + } + + if (len != sys_le16_to_cpu(hdr.len)) { + LOG_ERR("ACL payload length is not correct"); + net_buf_unref(buf); + return NULL; + } + + net_buf_add_mem(buf, &hdr, sizeof(hdr)); + buf_tailroom = net_buf_tailroom(buf); + if (buf_tailroom < len) { + LOG_ERR("Not enough space in buffer %zu/%zu", len, buf_tailroom); + net_buf_unref(buf); + return NULL; + } + + LOG_DBG("len %u", len); + net_buf_add_mem(buf, data, len); + + return buf; +} + +static void hci_b91_host_rcv_pkt(uint8_t *data, uint16_t len) +{ + uint8_t pkt_indicator; + struct net_buf *buf; + + LOG_HEXDUMP_DBG(data, len, "host packet data:"); + + pkt_indicator = *data++; + len -= sizeof(pkt_indicator); + + switch (pkt_indicator) { + case BT_HCI_H4_EVT: + buf = bt_b91_evt_recv(data, len); + break; + + case BT_HCI_H4_ACL: + buf = bt_b91_acl_recv(data, len); + break; + + default: + buf = NULL; + LOG_ERR("Unknown HCI type %u", pkt_indicator); + } + + if (buf) { + LOG_DBG("Calling bt_recv(%p)", buf); + bt_recv(buf); + } +} + +static void hci_b91_controller_rcv_pkt_ready(void) +{ + k_sem_give(&hci_send_sem); +} + +static b91_bt_host_callback_t vhci_host_cb = { + .host_send_available = hci_b91_controller_rcv_pkt_ready, + .host_read_packet = hci_b91_host_rcv_pkt +}; + +static int bt_b91_send(struct net_buf *buf) +{ + int err = 0; + uint8_t type; + + LOG_DBG("buf %p type %u len %u", buf, bt_buf_get_type(buf), buf->len); + + switch (bt_buf_get_type(buf)) { + case BT_BUF_ACL_OUT: + type = BT_HCI_H4_ACL; + break; + + case BT_BUF_CMD: + type = BT_HCI_H4_CMD; + break; + + default: + LOG_ERR("Unknown type %u", bt_buf_get_type(buf)); + goto done; + } + + LOG_HEXDUMP_DBG(buf->data, buf->len, "Final HCI buffer:"); + + if (k_sem_take(&hci_send_sem, HCI_BT_B91_TIMEOUT) == 0) { + b91_bt_host_send_packet(type, buf->data, buf->len); + } else { + LOG_ERR("Send packet timeout error"); + err = -ETIMEDOUT; + } + +done: + net_buf_unref(buf); + k_sem_give(&hci_send_sem); + + return err; +} + +static int hci_b91_open(void) +{ + int status; + + status = b91_bt_controller_init(); + if (status) { + LOG_ERR("Bluetooth controller init failed %d", status); + return status; + } + + b91_bt_host_callback_register(&vhci_host_cb); + + LOG_DBG("B91 BT started"); + + return 0; +} + +static const struct bt_hci_driver drv = { + .name = "BT B91", + .open = hci_b91_open, + .send = bt_b91_send, + .bus = BT_HCI_DRIVER_BUS_IPM, +#if defined(CONFIG_BT_DRIVER_QUIRK_NO_AUTO_DLE) + .quirks = BT_QUIRK_NO_AUTO_DLE, +#endif +}; + +static int bt_b91_init(void) +{ + + bt_hci_driver_register(&drv); + + return 0; +} + +SYS_INIT(bt_b91_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index 82ef50aaa72..f499ffab984 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -53,6 +53,7 @@ config BT_HCI_TX_STACK_SIZE default 768 if BT_CTLR && BT_LL_SW_SPLIT default 512 if BT_USERCHAN default 640 if BT_STM32_IPM + default 1024 if BT_B91 # Even if no driver is selected the following default is still # needed e.g. for unit tests. This default will also server as # the worst-case stack size if an out-of-tree controller is used. diff --git a/west.yml b/west.yml index e34274c4747..cce99eae803 100644 --- a/west.yml +++ b/west.yml @@ -234,7 +234,7 @@ manifest: groups: - hal - name: hal_telink - revision: 4226c7fc17d5a34e557d026d428fc766191a0800 + revision: 38573af589173259801ae6c2b34b7d4c9e626746 path: modules/hal/telink groups: - hal From 3b74d02633a260776aacd6b60eb38b8e637f689e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 261/825] Revert "[nrf fromtree] Bluetooth: samples: hci_ipc: Fix incorrect NULL pointer check" This reverts commit e451f0a62ebabc8df60f688d9ac7d0b564575720. --- samples/bluetooth/hci_ipc/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bluetooth/hci_ipc/src/main.c b/samples/bluetooth/hci_ipc/src/main.c index 814001646e4..5f0614139be 100644 --- a/samples/bluetooth/hci_ipc/src/main.c +++ b/samples/bluetooth/hci_ipc/src/main.c @@ -294,7 +294,7 @@ void bt_ctlr_assert_handle(char *file, uint32_t line) struct net_buf *buf; buf = hci_vs_err_assert(file, line); - if (buf != NULL) { + if (buf == NULL) { /* Send the event over ipc */ hci_ipc_send(buf, HCI_FATAL_ERR_MSG); } else { From 22bc48a2a909c6af87db77277296900d1be4c732 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 262/825] Revert "[nrf fromtree] net: ipv6: routing: decide whether to set interface's LL address" This reverts commit 3d8a0bd1aa589d945c92476592794889e2f41f3d. --- subsys/net/ip/route.c | 90 +++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 51 deletions(-) diff --git a/subsys/net/ip/route.c b/subsys/net/ip/route.c index a74c3a0ec26..43a754556e1 100644 --- a/subsys/net/ip/route.c +++ b/subsys/net/ip/route.c @@ -1008,27 +1008,6 @@ bool net_route_get_info(struct net_if *iface, return ret; } -static bool is_ll_addr_supported(struct net_if *iface) -{ -#if defined(CONFIG_NET_L2_DUMMY) - if (net_if_l2(iface) == &NET_L2_GET_NAME(DUMMY)) { - return false; - } -#endif -#if defined(CONFIG_NET_L2_PPP) - if (net_if_l2(iface) == &NET_L2_GET_NAME(PPP)) { - return false; - } -#endif -#if defined(CONFIG_NET_L2_OPENTHREAD) - if (net_if_l2(iface) == &NET_L2_GET_NAME(OPENTHREAD)) { - return false; - } -#endif - - return true; -} - int net_route_packet(struct net_pkt *pkt, struct in6_addr *nexthop) { struct net_linkaddr_storage *lladdr; @@ -1053,36 +1032,48 @@ int net_route_packet(struct net_pkt *pkt, struct in6_addr *nexthop) goto error; } - if (is_ll_addr_supported(net_pkt_iface(pkt)) && - is_ll_addr_supported(net_pkt_orig_iface(pkt))) { - if (!net_pkt_lladdr_src(pkt)->addr) { - NET_DBG("Link layer source address not set"); - err = -EINVAL; - goto error; - } +#if defined(CONFIG_NET_L2_DUMMY) + /* No need to do this check for dummy L2 as it does not have any + * link layer. This is done at runtime because we can have multiple + * network technologies enabled. + */ + if (net_if_l2(net_pkt_iface(pkt)) != &NET_L2_GET_NAME(DUMMY)) { +#endif +#if defined(CONFIG_NET_L2_PPP) + /* PPP does not populate the lladdr fields */ + if (net_if_l2(net_pkt_iface(pkt)) != &NET_L2_GET_NAME(PPP)) { +#endif + if (!net_pkt_lladdr_src(pkt)->addr) { + NET_DBG("Link layer source address not set"); + err = -EINVAL; + goto error; + } - /* Sanitycheck: If src and dst ll addresses are going - * to be same, then something went wrong in route - * lookup. - */ - if (!memcmp(net_pkt_lladdr_src(pkt)->addr, lladdr->addr, - lladdr->len)) { - NET_ERR("Src ll and Dst ll are same"); - err = -EINVAL; - goto error; + /* Sanitycheck: If src and dst ll addresses are going + * to be same, then something went wrong in route + * lookup. + */ + if (!memcmp(net_pkt_lladdr_src(pkt)->addr, lladdr->addr, + lladdr->len)) { + NET_ERR("Src ll and Dst ll are same"); + err = -EINVAL; + goto error; + } +#if defined(CONFIG_NET_L2_PPP) } +#endif +#if defined(CONFIG_NET_L2_DUMMY) } +#endif net_pkt_set_forwarding(pkt, true); - /* Set the source ll address of the iface (if relevant) and the - * destination address to be the nexthop recipient. + /* Set the destination and source ll address in the packet. + * We set the destination address to be the nexthop recipient. */ - if (is_ll_addr_supported(net_pkt_iface(pkt))) { - net_pkt_lladdr_src(pkt)->addr = net_pkt_lladdr_if(pkt)->addr; - net_pkt_lladdr_src(pkt)->type = net_pkt_lladdr_if(pkt)->type; - net_pkt_lladdr_src(pkt)->len = net_pkt_lladdr_if(pkt)->len; - } + net_pkt_lladdr_src(pkt)->addr = net_pkt_lladdr_if(pkt)->addr; + net_pkt_lladdr_src(pkt)->type = net_pkt_lladdr_if(pkt)->type; + net_pkt_lladdr_src(pkt)->len = net_pkt_lladdr_if(pkt)->len; net_pkt_lladdr_dst(pkt)->addr = lladdr->addr; net_pkt_lladdr_dst(pkt)->type = lladdr->type; @@ -1091,7 +1082,6 @@ int net_route_packet(struct net_pkt *pkt, struct in6_addr *nexthop) net_pkt_set_iface(pkt, nbr->iface); net_ipv6_nbr_unlock(); - return net_send_data(pkt); error: @@ -1104,17 +1094,15 @@ int net_route_packet_if(struct net_pkt *pkt, struct net_if *iface) /* The destination is reachable via iface. But since no valid nexthop * is known, net_pkt_lladdr_dst(pkt) cannot be set here. */ + net_pkt_set_orig_iface(pkt, net_pkt_iface(pkt)); net_pkt_set_iface(pkt, iface); net_pkt_set_forwarding(pkt, true); - /* Set source LL address if only if relevant */ - if (is_ll_addr_supported(iface)) { - net_pkt_lladdr_src(pkt)->addr = net_pkt_lladdr_if(pkt)->addr; - net_pkt_lladdr_src(pkt)->type = net_pkt_lladdr_if(pkt)->type; - net_pkt_lladdr_src(pkt)->len = net_pkt_lladdr_if(pkt)->len; - } + net_pkt_lladdr_src(pkt)->addr = net_pkt_lladdr_if(pkt)->addr; + net_pkt_lladdr_src(pkt)->type = net_pkt_lladdr_if(pkt)->type; + net_pkt_lladdr_src(pkt)->len = net_pkt_lladdr_if(pkt)->len; return net_send_data(pkt); } From ae89e6860c10529a1e14480c95d96158b726016b Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 263/825] Revert "[nrf fromtree] net: ipv6: routing: do not add route to original iface without ND" This reverts commit ff1c3ba93ce8b7cf996fab13fb8f2977f82a115b. --- subsys/net/ip/ipv6.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/subsys/net/ip/ipv6.c b/subsys/net/ip/ipv6.c index 0eae9f2dc5a..017987aa006 100644 --- a/subsys/net/ip/ipv6.c +++ b/subsys/net/ip/ipv6.c @@ -346,8 +346,7 @@ static enum net_verdict ipv6_route_packet(struct net_pkt *pkt, } if (IS_ENABLED(CONFIG_NET_ROUTING) && - net_pkt_orig_iface(pkt) != net_pkt_iface(pkt) && - !net_if_flag_is_set(net_pkt_orig_iface(pkt), NET_IF_IPV6_NO_ND)) { + net_pkt_orig_iface(pkt) != net_pkt_iface(pkt)) { /* If the route interface to destination is * different than the original route, then add * route to original source. From 824df1db54de4a92b0e230febc2c0f0e9f8c73fc Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 264/825] Revert "[nrf fromlist] dts: nrf54h20: add missing global dppic and ipct configs" This reverts commit c15356d667514045876fcecae26cf97ebe4be0b5. --- dts/arm/nordic/nrf54h20_cpurad.dtsi | 31 ++++++++--------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index 2af6070f046..20da9dbe3cd 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -59,36 +59,21 @@ wdt011: &cpurad_wdt011 {}; }; &dppic130 { - owned-channels = <0 2 3>; - sink-channels = <0 2>; - source-channels = <3>; - nonsecure-channels = <0 2 3>; + owned-channels = <0>; + sink-channels = <0>; + nonsecure-channels = <0>; status = "okay"; }; &dppic132 { - owned-channels = <0 2 3>; - sink-channels = <3>; - source-channels = <0 2>; - nonsecure-channels = <0 2 3>; + owned-channels = <0>; + source-channels = <0>; + nonsecure-channels = <0>; status = "okay"; }; &ipct130 { - status = "okay"; - owned-channels = <0 2>; - sink-channel-links = <2 NRF_DOMAIN_ID_RADIOCORE 2>; - source-channel-links = <0 NRF_DOMAIN_ID_RADIOCORE 0>, - <2 NRF_DOMAIN_ID_RADIOCORE 2>; -}; - -&cpurad_ipct { - status = "okay"; - sink-channel-links = <0 NRF_DOMAIN_ID_GLOBALSLOW 0>, - <2 NRF_DOMAIN_ID_GLOBALSLOW 2>; - source-channel-links = <2 NRF_DOMAIN_ID_GLOBALSLOW 2>; -}; - -&dppic020 { + owned-channels = <0>; + source-channel-links = <0 3 0>; status = "okay"; }; From eb49f8a3ea0415089f9f4298b3051632bbb153c6 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 265/825] Revert "[nrf fromlist] modules: hal_nordic: adjust HFCLK ramp-up time." This reverts commit 788e4f3ea301c6ead435bd296a77ae6f3a0a0818. --- .../sl_opensource/platform/nrf_802154_clock_zephyr.c | 3 +-- 1 file changed, 1 insertion(+), 2 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 f9da7537dc1..1db86f5ad14 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 @@ -78,8 +78,7 @@ void nrf_802154_clock_hfclk_stop(void) #elif defined(NRF54H_SERIES) #define NRF_LRCCONF_RADIO_PD NRF_LRCCONF010 -/* HF clock time to ramp-up. */ -#define MAX_HFXO_RAMP_UP_TIME_US 550 +#define MAX_HFXO_RAMP_UP_TIME_US 1000 static void hfclk_started_timer_handler(struct k_timer *dummy) { From bbc5326669edb8a61e8a6197c383a1db659c3656 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 266/825] Revert "[nrf fromlist] samples: drivers: mbox: Allow coverage calculation" This reverts commit 5f9860846da7459ba7acc0b3ca1fe0780c291099. --- samples/drivers/mbox/src/main.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/samples/drivers/mbox/src/main.c b/samples/drivers/mbox/src/main.c index 06e10721fc7..33430dcdd19 100644 --- a/samples/drivers/mbox/src/main.c +++ b/samples/drivers/mbox/src/main.c @@ -46,11 +46,7 @@ int main(void) printk("Maximum bytes of data in the TX message: %d\n", mbox_mtu_get_dt(&tx_channel)); printk("Maximum TX channels: %d\n", mbox_max_channels_get_dt(&tx_channel)); -#ifndef CONFIG_COVERAGE while (1) { -#else - for (int i = 0; i < 5; i++) { -#endif #if defined(CONFIG_MULTITHREADING) k_sleep(K_MSEC(2000)); #else @@ -66,13 +62,5 @@ int main(void) } } #endif /* CONFIG_TX_ENABLED */ - -#ifdef CONFIG_RX_ENABLED - ret = mbox_set_enabled_dt(&rx_channel, false); - if (ret < 0) { - printk("Could not disable RX channel %d (%d)\n", rx_channel.channel_id, ret); - return 0; - } -#endif /* CONFIG_RX_ENABLED */ return 0; } From 38f368340a46da53f7720fe3628ea97aaaa7addc Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 267/825] Revert "[nrf fromlist] manifest: net: openthread: Regular openthread upmerge to `e10a925`." This reverts commit c784caa9b325c851e0b964e2c5759b0e75c00c6c. --- modules/openthread/platform/diag.c | 36 +++++++----------------------- west.yml | 2 +- 2 files changed, 9 insertions(+), 29 deletions(-) diff --git a/modules/openthread/platform/diag.c b/modules/openthread/platform/diag.c index a55368bb10f..1386cb167ee 100644 --- a/modules/openthread/platform/diag.c +++ b/modules/openthread/platform/diag.c @@ -16,39 +16,19 @@ * */ static bool sDiagMode; -static void *sDiagCallbackContext; -static otPlatDiagOutputCallback sDiagOutputCallback; -static void diag_output(const char *aFormat, ...) -{ - va_list args; - - va_start(args, aFormat); - - if (sDiagOutputCallback != NULL) { - sDiagOutputCallback(aFormat, args, sDiagCallbackContext); - } - - va_end(args); -} - -void otPlatDiagSetOutputCallback(otInstance *aInstance, - otPlatDiagOutputCallback aCallback, - void *aContext) -{ - OT_UNUSED_VARIABLE(aInstance); - - sDiagOutputCallback = aCallback; - sDiagCallbackContext = aContext; -} - -otError otPlatDiagProcess(otInstance *aInstance, uint8_t aArgsLength, char *aArgs[]) +otError otPlatDiagProcess(otInstance *aInstance, + uint8_t argc, + char *argv[], + char *aOutput, + size_t aOutputMaxLen) { + ARG_UNUSED(argc); ARG_UNUSED(aInstance); - ARG_UNUSED(aArgsLength); /* Add more platform specific diagnostics features here. */ - diag_output("diag feature '%s' is not supported\r\n", aArgs[0]); + snprintk(aOutput, aOutputMaxLen, + "diag feature '%s' is not supported\r\n", argv[0]); return OT_ERROR_NOT_IMPLEMENTED; } diff --git a/west.yml b/west.yml index cce99eae803..40c67b2d575 100644 --- a/west.yml +++ b/west.yml @@ -301,7 +301,7 @@ manifest: revision: da78aea63159771956fe0c9263f2e6985b66e9d5 path: modules/lib/open-amp - name: openthread - revision: e10a92570f94ff1e0bc5e0da9ecf0ee135d955a6 + revision: 3873c6fcd5a8a9dd01b71e8efe32ef5dc7923bb1 path: modules/lib/openthread - name: percepio path: modules/debug/percepio From ca84bcb3f924e7d3c9a6dfacbb902d43dc2623f7 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 268/825] Revert "[nrf fromtree] net: openthread: Add new kconfig OT options." This reverts commit 1d32786dd03b236a6ccf419196ea1703572cd8df. --- modules/openthread/CMakeLists.txt | 5 ----- modules/openthread/Kconfig.features | 15 --------------- 2 files changed, 20 deletions(-) diff --git a/modules/openthread/CMakeLists.txt b/modules/openthread/CMakeLists.txt index c155fab65f9..c638d3394f4 100644 --- a/modules/openthread/CMakeLists.txt +++ b/modules/openthread/CMakeLists.txt @@ -44,13 +44,11 @@ kconfig_to_ot_option(CONFIG_OPENTHREAD_BACKBONE_ROUTER_DUA_NDPROXYING OT_BACKBON kconfig_to_ot_option(CONFIG_OPENTHREAD_BACKBONE_ROUTER_MULTICAST_ROUTING OT_BACKBONE_ROUTER_MULTICAST_ROUTING "Enable BBR MR support") kconfig_to_ot_option(CONFIG_OPENTHREAD_BLE_TCAT OT_BLE_TCAT "Enable BLE TCAT support") kconfig_to_ot_option(CONFIG_OPENTHREAD_BORDER_AGENT OT_BORDER_AGENT "Enable Border Agent") -kconfig_to_ot_option(CONFIG_OPENTHREAD_BORDER_AGENT_EPHEMERAL_KEY_ENABLE OT_BORDER_AGENT_EPSKC "Border agent ephemeral PSKc") kconfig_to_ot_option(CONFIG_OPENTHREAD_BORDER_ROUTER OT_BORDER_ROUTER "Enable Border Router") kconfig_to_ot_option(CONFIG_OPENTHREAD_BORDER_ROUTING OT_BORDER_ROUTING "Enable Border routing") kconfig_to_ot_option(CONFIG_OPENTHREAD_BORDER_ROUTING_COUNTERS OT_BORDER_ROUTING_COUNTERS "Enable Border routing counters") kconfig_to_ot_option(CONFIG_OPENTHREAD_BORDER_ROUTING_DHCP6_PD OT_BORDER_ROUTING_DHCP6_PD "DHCPv6-PD support in border routing") kconfig_to_ot_option(CONFIG_OPENTHREAD_CHANNEL_MANAGER OT_CHANNEL_MANAGER "Enable channel manager support") -kconfig_to_ot_option(CONFIG_OPENTHREAD_CHANNEL_MANAGER_CSL OT_CHANNEL_MANAGER_CSL "Channel manager for CSL channel") kconfig_to_ot_option(CONFIG_OPENTHREAD_CHANNEL_MONITOR OT_CHANNEL_MONITOR "Enable channel monitor support") kconfig_to_ot_option(CONFIG_OPENTHREAD_COAP OT_COAP "Enable CoAP API") kconfig_to_ot_option(CONFIG_OPENTHREAD_COAP_BLOCK OT_COAP_BLOCK "Enable CoAP Block-wise option support") @@ -85,10 +83,8 @@ kconfig_to_ot_option(CONFIG_OPENTHREAD_LEGACY OT_LEGACY "Enable legacy network s kconfig_to_ot_option(CONFIG_OPENTHREAD_LINK_METRICS_INITIATOR OT_LINK_METRICS_INITIATOR "Enable Link Metrics initiator for Thread 1.2") kconfig_to_ot_option(CONFIG_OPENTHREAD_LINK_METRICS_MANAGER OT_LINK_METRICS_MANAGER "Enable Link Metrics manager for Thread 1.2") kconfig_to_ot_option(CONFIG_OPENTHREAD_LINK_METRICS_SUBJECT OT_LINK_METRICS_SUBJECT "Enable Link Metrics subject for Thread 1.2") -kconfig_to_ot_option(CONFIG_OPENTHREAD_PLATFORM_LOG_CRASH_DUMP OT_PLATFORM_LOG_CRASH_DUMP "Platform log crash dump") kconfig_to_ot_option(CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC OT_LOG_LEVEL_DYNAMIC "Enable dynamic log level control") kconfig_to_ot_option(CONFIG_OPENTHREAD_MAC_FILTER OT_MAC_FILTER "Enable MAC filter support") -kconfig_to_ot_option(CONFIG_OPENTHREAD_MULTICAST_DNS OT_MDNS "multicast DNS (mDNS)") kconfig_to_ot_option(CONFIG_OPENTHREAD_MESH_DIAG OT_MESH_DIAG "Enable Mesh Diagnostics") kconfig_to_ot_option(CONFIG_OPENTHREAD_MESSAGE_USE_HEAP OT_MESSAGE_USE_HEAP "Enable heap allocator for message buffers") kconfig_to_ot_option(CONFIG_OPENTHREAD_MLE_LONG_ROUTES OT_MLE_LONG_ROUTES "Enable MLE long routes support (Experimental)") @@ -123,7 +119,6 @@ kconfig_to_ot_option(CONFIG_OPENTHREAD_TX_BEACON_PAYLOAD OT_TX_BEACON_PAYLOAD "E kconfig_to_ot_option(CONFIG_OPENTHREAD_TX_QUEUE_STATISTICS OT_TX_QUEUE_STATS "Enable tx queue statistics") kconfig_to_ot_option(CONFIG_OPENTHREAD_UDP_FORWARD OT_UDP_FORWARD "Enable UDP forward feature") kconfig_to_ot_option(CONFIG_OPENTHREAD_UPTIME OT_UPTIME "Enable support for tracking OpenThread instance's uptime") -kconfig_to_ot_option(CONFIG_OPENTHREAD_VERHOEFF_CHECKSUM OT_VERHOEFF_CHECKSUM "Verhoeff checksum") 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.features b/modules/openthread/Kconfig.features index 32f451ca38e..7fd9ed50802 100644 --- a/modules/openthread/Kconfig.features +++ b/modules/openthread/Kconfig.features @@ -46,9 +46,6 @@ config OPENTHREAD_BLE_TCAT config OPENTHREAD_BORDER_AGENT bool "Border Agent support" -config OPENTHREAD_BORDER_AGENT_EPHEMERAL_KEY_ENABLE - bool "Border agent ephemeral PSKc" - config OPENTHREAD_BORDER_ROUTER bool "Border Router support" @@ -68,9 +65,6 @@ config OPENTHREAD_CHANNEL_MANAGER bool "Channel manager support" depends on OPENTHREAD_CHANNEL_MONITOR -config OPENTHREAD_CHANNEL_MANAGER_CSL - bool "Channel manager for CSL channel" - config OPENTHREAD_COAP bool "OpenThread CoAP support" help @@ -198,18 +192,12 @@ config OPENTHREAD_LINK_METRICS_MANAGER config OPENTHREAD_LINK_METRICS_SUBJECT bool "Link Metrics subject" -config OPENTHREAD_PLATFORM_LOG_CRASH_DUMP - bool "Platform log crash dump" - config OPENTHREAD_LOG_LEVEL_DYNAMIC bool "Dynamic log level control" config OPENTHREAD_MAC_FILTER bool "MAC filter support" -config OPENTHREAD_MULTICAST_DNS - bool "Multicast DNS (mDNS)" - config OPENTHREAD_MESH_DIAG bool "Mesh Diagnostics" depends on OPENTHREAD_FTD @@ -371,6 +359,3 @@ config OPENTHREAD_UDP_FORWARD config OPENTHREAD_UPTIME bool "Openthread uptime counter" default y if OPENTHREAD_FTD - -config OPENTHREAD_VERHOEFF_CHECKSUM - bool "Verhoeff checksum" From 768114a72b22e6bbe4efd1ac860baff7306064f5 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 269/825] Revert "[nrf fromtree] net: openthread: Add implementation of TCAT advertisement." This reverts commit 44b2b002b66a8c011458cdfa9e2de49a3d98435e. --- modules/openthread/platform/ble.c | 54 +++---------------------------- 1 file changed, 4 insertions(+), 50 deletions(-) diff --git a/modules/openthread/platform/ble.c b/modules/openthread/platform/ble.c index 55330e1ffe7..7b41556b617 100644 --- a/modules/openthread/platform/ble.c +++ b/modules/openthread/platform/ble.c @@ -23,9 +23,7 @@ #include /* OpenThread BLE driver API */ -#include #include -#include /* Zephyr Logging */ @@ -102,17 +100,13 @@ static struct bt_conn_cb conn_callbacks = {.connected = connected, .le_param_req = le_param_req, .le_param_updated = le_param_updated}; -static uint8_t service_data[OT_TCAT_ADVERTISEMENT_MAX_LEN] = {0}; -static const uint8_t service_data_size = ARRAY_SIZE(service_data); - -static struct bt_data ad[] = { +static const struct bt_data ad[] = { BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)), - BT_DATA(BT_DATA_SVC_DATA16, service_data, service_data_size), + BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN), }; -static struct bt_data sd[] = { +static const struct bt_data sd[] = { BT_DATA_BYTES(BT_DATA_UUID16_ALL, BT_UUID_16_ENCODE(TOBLE_SERVICE_UUID)), - BT_DATA(BT_DATA_SVC_DATA16, service_data, service_data_size), }; /* Zephyr BLE Message Queue and Thread */ @@ -394,52 +388,12 @@ static void bt_ready(int err) k_sem_give(&ot_plat_ble_init_semaphore); /* BLE stack up an running */ } -void otPlatBleGetLinkCapabilities(otInstance *aInstance, - otBleLinkCapabilities *aBleLinkCapabilities) -{ - ARG_UNUSED(aInstance); - - aBleLinkCapabilities->mGattNotifications = 1; - aBleLinkCapabilities->mL2CapDirect = 0; - aBleLinkCapabilities->mRsv = 0; -} - -bool otPlatBleSupportsMultiRadio(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - return false; -} - -otError otPlatBleGetAdvertisementBuffer(otInstance *aInstance, uint8_t **aAdvertisementBuffer) -{ - ARG_UNUSED(aInstance); - - *aAdvertisementBuffer = service_data; - - return OT_ERROR_NONE; -} - -otError otPlatBleGapAdvSetData(otInstance *aInstance, uint8_t *aAdvertisementData, - uint16_t aAdvertisementLen) -{ - ARG_UNUSED(aInstance); - - if (aAdvertisementLen > OT_TCAT_ADVERTISEMENT_MAX_LEN || aAdvertisementData == NULL) { - LOG_ERR("Invalid TCAT Advertisement parameters advlen: %d", aAdvertisementLen); - return OT_ERROR_INVALID_ARGS; - } - - ad[1].data_len = (uint8_t)aAdvertisementLen; - sd[1].data_len = (uint8_t)aAdvertisementLen; - return OT_ERROR_NONE; -} - otError otPlatBleGapAdvStart(otInstance *aInstance, uint16_t aInterval) { ARG_UNUSED(aInstance); ARG_UNUSED(aInterval); + /* TO DO advertisement format change */ int err = bt_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd)); if (err != 0 && err != -EALREADY) { From fdf7c0a8ce7e52cfcdba66f03eed9e10a317fc6a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 270/825] Revert "[nrf fromtree] manifest: net: openthread: Regular openthread upmerge to `3873c6f`." This reverts commit 97595a3a5821418452d3c7e5f40ecc36d15af817. --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 40c67b2d575..e0c277e4ebe 100644 --- a/west.yml +++ b/west.yml @@ -301,7 +301,7 @@ manifest: revision: da78aea63159771956fe0c9263f2e6985b66e9d5 path: modules/lib/open-amp - name: openthread - revision: 3873c6fcd5a8a9dd01b71e8efe32ef5dc7923bb1 + revision: 49c59ec519cc8b49dd58978d1bc80b7ae7ba88d0 path: modules/lib/openthread - name: percepio path: modules/debug/percepio From 5b46a98150a02872f31fcad5e2f41a35571e0bc4 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 271/825] Revert "[nrf fromtree] tests: drivers: counter: nrf: fixed_top: Rework nrf54h20 cpuppr config" This reverts commit 93a1b8c86417acd6701410c88bf0f2d2bb2c74eb. --- .../nrf54h20dk_nrf54h20_vpr_launcher.overlay} | 0 .../fixed_top/sysbuild/vpr_launcher/prj.conf | 1 - .../counter/counter_nrf_rtc/fixed_top/testcase.yaml | 13 ++++++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) rename tests/drivers/counter/counter_nrf_rtc/fixed_top/{sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay => boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay} (100%) delete mode 100644 tests/drivers/counter/counter_nrf_rtc/fixed_top/sysbuild/vpr_launcher/prj.conf diff --git a/tests/drivers/counter/counter_nrf_rtc/fixed_top/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay similarity index 100% rename from tests/drivers/counter/counter_nrf_rtc/fixed_top/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay rename to tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay diff --git a/tests/drivers/counter/counter_nrf_rtc/fixed_top/sysbuild/vpr_launcher/prj.conf b/tests/drivers/counter/counter_nrf_rtc/fixed_top/sysbuild/vpr_launcher/prj.conf deleted file mode 100644 index b2a4ba59104..00000000000 --- a/tests/drivers/counter/counter_nrf_rtc/fixed_top/sysbuild/vpr_launcher/prj.conf +++ /dev/null @@ -1 +0,0 @@ -# nothing here 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 8706077f2a0..d31ab2a1602 100644 --- a/tests/drivers/counter/counter_nrf_rtc/fixed_top/testcase.yaml +++ b/tests/drivers/counter/counter_nrf_rtc/fixed_top/testcase.yaml @@ -9,4 +9,15 @@ tests: - nrf52_bsim - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - - nrf54h20dk/nrf54h20/cpuppr + drivers.counter.nrf_rtc.nrf54h20_cpuppr: + tags: + - drivers + - counter + depends_on: counter + platform_allow: nrf54h20dk/nrf54h20/cpuppr + sysbuild: true + extra_args: + - vpr_launcher_DTC_OVERLAY_FILE="../../../tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay" + - SB_CONFIG_VPR_LAUNCHER=y + # Disable asserts to fit in limited code memory + - CONFIG_ASSERT=n From d67c0f8d8843954805ec319938797262ac81db2e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 272/825] Revert "[nrf fromtree] tests: drivers: counter: basic_api: Rework nrf54h20 cpuppr config" This reverts commit e2290163f5403184ddb226a1768b14e60228954a. --- .../nrf54h20dk_nrf54h20_vpr_launcher.overlay} | 2 +- .../sysbuild/vpr_launcher/prj.conf | 1 - .../drivers/counter/counter_basic_api/testcase.yaml | 13 +++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) rename tests/drivers/counter/counter_basic_api/{sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay => boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay} (94%) delete mode 100644 tests/drivers/counter/counter_basic_api/sysbuild/vpr_launcher/prj.conf diff --git a/tests/drivers/counter/counter_basic_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay similarity index 94% rename from tests/drivers/counter/counter_basic_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay rename to tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay index cf3a4cf1258..70baea93a07 100644 --- a/tests/drivers/counter/counter_basic_api/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: Apache-2.0 */ + /* SPDX-License-Identifier: Apache-2.0 */ &timer130 { status = "reserved"; diff --git a/tests/drivers/counter/counter_basic_api/sysbuild/vpr_launcher/prj.conf b/tests/drivers/counter/counter_basic_api/sysbuild/vpr_launcher/prj.conf deleted file mode 100644 index b2a4ba59104..00000000000 --- a/tests/drivers/counter/counter_basic_api/sysbuild/vpr_launcher/prj.conf +++ /dev/null @@ -1 +0,0 @@ -# nothing here diff --git a/tests/drivers/counter/counter_basic_api/testcase.yaml b/tests/drivers/counter/counter_basic_api/testcase.yaml index 482fc9c54eb..2b4e978f142 100644 --- a/tests/drivers/counter/counter_basic_api/testcase.yaml +++ b/tests/drivers/counter/counter_basic_api/testcase.yaml @@ -38,3 +38,16 @@ tests: timeout: 400 extra_args: DTC_OVERLAY_FILE="boards/mimxrt685_evk_rtc_1khz.overlay" + drivers.counter.basic_api.nrf54h20_cpuppr: + tags: + - drivers + - counter + depends_on: counter + platform_allow: nrf54h20dk/nrf54h20/cpuppr + timeout: 600 + sysbuild: true + extra_args: + - vpr_launcher_DTC_OVERLAY_FILE="../../../tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay" + - SB_CONFIG_VPR_LAUNCHER=y + # Disable asserts to fit in limited code memory + - CONFIG_ASSERT=n From 4b097859d6d0f118c2d4217c64d703fbede14897 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 273/825] Revert "[nrf fromtree] tests: drivers: counter: counter_basic_api: Add nrf54h20 ppr" This reverts commit 2e04dd59fde84f69ef568af46f84e09f8866abbf. --- .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 12 ----- .../nrf54h20dk_nrf54h20_vpr_launcher.overlay | 51 ------------------- .../counter/counter_basic_api/testcase.yaml | 13 ----- 3 files changed, 76 deletions(-) delete mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_cpuppr.overlay delete mode 100644 tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_cpuppr.overlay deleted file mode 100644 index dfc5d1a9b82..00000000000 --- a/tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_cpuppr.overlay +++ /dev/null @@ -1,12 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -#include "nrf54h20dk_nrf54h20_common.dtsi" - -/* PPR does not have interrupts for fast peripherals. */ -&timer120 { - status = "disabled"; -}; - -&timer121 { - status = "disabled"; -}; diff --git a/tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay b/tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay deleted file mode 100644 index 70baea93a07..00000000000 --- a/tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay +++ /dev/null @@ -1,51 +0,0 @@ - /* SPDX-License-Identifier: Apache-2.0 */ - -&timer130 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; - -&timer131 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; - -&timer132 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; - -&timer133 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; - -&timer134 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; - -&timer135 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; - -&timer136 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; - -&timer137 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; - -&rtc130 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; - -&rtc131 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; diff --git a/tests/drivers/counter/counter_basic_api/testcase.yaml b/tests/drivers/counter/counter_basic_api/testcase.yaml index 2b4e978f142..482fc9c54eb 100644 --- a/tests/drivers/counter/counter_basic_api/testcase.yaml +++ b/tests/drivers/counter/counter_basic_api/testcase.yaml @@ -38,16 +38,3 @@ tests: timeout: 400 extra_args: DTC_OVERLAY_FILE="boards/mimxrt685_evk_rtc_1khz.overlay" - drivers.counter.basic_api.nrf54h20_cpuppr: - tags: - - drivers - - counter - depends_on: counter - platform_allow: nrf54h20dk/nrf54h20/cpuppr - timeout: 600 - sysbuild: true - extra_args: - - vpr_launcher_DTC_OVERLAY_FILE="../../../tests/drivers/counter/counter_basic_api/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay" - - SB_CONFIG_VPR_LAUNCHER=y - # Disable asserts to fit in limited code memory - - CONFIG_ASSERT=n From 26640189a0531725f8698e9470b094371dd0c2c8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 274/825] Revert "[nrf fromtree] tests: drivers: counter: basic_api: Tweak test timing" This reverts commit f17033a6d745442dbb1abe0e79329758627b6a52. --- tests/drivers/counter/counter_basic_api/src/test_counter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/drivers/counter/counter_basic_api/src/test_counter.c b/tests/drivers/counter/counter_basic_api/src/test_counter.c index 75c9ae3b8ad..c9c8418b00f 100644 --- a/tests/drivers/counter/counter_basic_api/src/test_counter.c +++ b/tests/drivers/counter/counter_basic_api/src/test_counter.c @@ -887,7 +887,7 @@ static void test_cancelled_alarm_does_not_expire_instance(const struct device *d { int err; uint32_t cnt; - uint32_t us = 1500; + uint32_t us = 1000; uint32_t ticks = counter_us_to_ticks(dev, us); uint32_t top = counter_get_top_value(dev); From 32c1b3245d719ce006d11596933890f4f0cc3334 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 275/825] Revert "[nrf fromtree] tests: drivers: counter: nrf_rtc: fixed_top: Add nrf54h20 ppr" This reverts commit 70f3c15129eefd00f7370df847fe34af9686ee81. --- .../boards/nrf54h20dk_nrf54h20_cpuppr.overlay | 3 --- .../boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay | 11 ----------- .../counter/counter_nrf_rtc/fixed_top/testcase.yaml | 12 ------------ 3 files changed, 26 deletions(-) delete mode 100644 tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf54h20dk_nrf54h20_cpuppr.overlay delete mode 100644 tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay diff --git a/tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf54h20dk_nrf54h20_cpuppr.overlay deleted file mode 100644 index f65b4dd3b0b..00000000000 --- a/tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf54h20dk_nrf54h20_cpuppr.overlay +++ /dev/null @@ -1,3 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ - -#include "nrf54h20dk_nrf54h20_common.dtsi" diff --git a/tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay b/tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay deleted file mode 100644 index eef4236c642..00000000000 --- a/tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay +++ /dev/null @@ -1,11 +0,0 @@ - /* SPDX-License-Identifier: Apache-2.0 */ - -&rtc130 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; - -&rtc131 { - status = "reserved"; - interrupt-parent = <&cpuppr_clic>; -}; 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 d31ab2a1602..2260957e2c0 100644 --- a/tests/drivers/counter/counter_nrf_rtc/fixed_top/testcase.yaml +++ b/tests/drivers/counter/counter_nrf_rtc/fixed_top/testcase.yaml @@ -9,15 +9,3 @@ tests: - nrf52_bsim - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - drivers.counter.nrf_rtc.nrf54h20_cpuppr: - tags: - - drivers - - counter - depends_on: counter - platform_allow: nrf54h20dk/nrf54h20/cpuppr - sysbuild: true - extra_args: - - vpr_launcher_DTC_OVERLAY_FILE="../../../tests/drivers/counter/counter_nrf_rtc/fixed_top/boards/nrf54h20dk_nrf54h20_vpr_launcher.overlay" - - SB_CONFIG_VPR_LAUNCHER=y - # Disable asserts to fit in limited code memory - - CONFIG_ASSERT=n From 36c5ecd123aa69438290e579a8fda8b95a3be107 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 276/825] Revert "[nrf fromtree] tests: drivers: clock_control: nrf_lf_clock_start: Fix SYNTH test" This reverts commit 17f660fdeb2121253230a2a0108d4e8be461a28b. --- tests/drivers/clock_control/nrf_lf_clock_start/src/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/drivers/clock_control/nrf_lf_clock_start/src/main.c b/tests/drivers/clock_control/nrf_lf_clock_start/src/main.c index b2524e94409..f1b1e52c7c5 100644 --- a/tests/drivers/clock_control/nrf_lf_clock_start/src/main.c +++ b/tests/drivers/clock_control/nrf_lf_clock_start/src/main.c @@ -38,12 +38,15 @@ static void rc_check(bool on, nrf_clock_lfclk_t type) static void synth_check(bool on, nrf_clock_lfclk_t type) { -#ifdef CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH + #if !defined(CLOCK_LFCLKSRC_SRC_Synth) && \ + !defined(CLOCK_LFCLKSRC_SRC_LFSYNT) + #define NRF_CLOCK_LFCLK_SYNTH 0 + #endif + if (!IS_ENABLED(CONFIG_SYSTEM_CLOCK_NO_WAIT)) { zassert_true(on, "Clock should be on"); zassert_equal(type, NRF_CLOCK_LFCLK_SYNTH); } -#endif } ZTEST(nrf_lf_clock_start, test_clock_check) From 40f69192184b15dffb77a6a403554579729c7e7f Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:04 +0200 Subject: [PATCH 277/825] Revert "[nrf fromlist] samples: subsys: ipc: icmsg: Align to NO MULTITHREADING" This reverts commit bac6ef751a8cc1763b1129fb57da0fd75cb4cc46. --- .../nrf54l15pdk_nrf54l15_cpuflpr.overlay | 4 -- .../ipc/ipc_service/icmsg/remote/src/main.c | 43 ++------------ .../subsys/ipc/ipc_service/icmsg/sample.yaml | 59 +------------------ .../subsys/ipc/ipc_service/icmsg/src/main.c | 38 +----------- 4 files changed, 8 insertions(+), 136 deletions(-) diff --git a/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay b/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay index b0e1f0d5034..2219b7b78fa 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay +++ b/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay @@ -39,7 +39,3 @@ &cpuflpr_vevif_tx { status = "okay"; }; - -&uart30 { - /delete-property/ hw-flow-control; -}; diff --git a/samples/subsys/ipc/ipc_service/icmsg/remote/src/main.c b/samples/subsys/ipc/ipc_service/icmsg/remote/src/main.c index e4b51369cdc..5cabd03ac77 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/remote/src/main.c +++ b/samples/subsys/ipc/ipc_service/icmsg/remote/src/main.c @@ -14,44 +14,26 @@ #include LOG_MODULE_REGISTER(remote, LOG_LEVEL_INF); -#if defined(CONFIG_MULTITHREADING) -K_SEM_DEFINE(bound_sem, 0, 1); -#else -volatile uint32_t bound_sem = 1; -volatile uint32_t recv_sem = 1; -#endif -static unsigned char expected_message = 'a'; -static size_t expected_len = PACKET_SIZE_START; -static size_t received; +K_SEM_DEFINE(bound_sem, 0, 1); static void ep_bound(void *priv) { - received = 0; -#if defined(CONFIG_MULTITHREADING) k_sem_give(&bound_sem); -#else - bound_sem = 0; -#endif LOG_INF("Ep bounded"); } static void ep_recv(const void *data, size_t len, void *priv) { -#if defined(CONFIG_ASSERT) struct data_packet *packet = (struct data_packet *)data; + static unsigned char expected_message = 'a'; + static size_t expected_len = PACKET_SIZE_START; __ASSERT(packet->data[0] == expected_message, "Unexpected message. Expected %c, got %c", expected_message, packet->data[0]); __ASSERT(len == expected_len, "Unexpected length. Expected %zu, got %zu", expected_len, len); -#endif - -#ifndef CONFIG_MULTITHREADING - recv_sem = 0; -#endif - received += len; expected_message++; expected_len++; @@ -79,17 +61,11 @@ static int send_for_time(struct ipc_ept *ep, const int64_t sending_time_ms) ret = ipc_service_send(ep, &msg, mlen); if (ret == -ENOMEM) { /* No space in the buffer. Retry. */ - ret = 0; continue; } else if (ret < 0) { LOG_ERR("Failed to send (%c) failed with ret %d", msg.data[0], ret); break; } -#if !defined(CONFIG_MULTITHREADING) - else { - recv_sem = 1; - } -#endif msg.data[0]++; if (msg.data[0] > 'Z') { @@ -103,12 +79,7 @@ static int send_for_time(struct ipc_ept *ep, const int64_t sending_time_ms) mlen = PACKET_SIZE_START; } -#if defined(CONFIG_MULTITHREADING) k_usleep(1); -#else - while ((recv_sem != 0) && ((k_uptime_get() - start) < sending_time_ms)) { - }; -#endif } LOG_INF("Sent %zu [Bytes] over %lld [ms]", bytes_sent, sending_time_ms); @@ -140,17 +111,12 @@ int main(void) } ret = ipc_service_register_endpoint(ipc0_instance, &ep, &ep_cfg); - if (ret < 0) { + if (ret != 0) { LOG_ERR("ipc_service_register_endpoint() failure"); return ret; } -#if defined(CONFIG_MULTITHREADING) k_sem_take(&bound_sem, K_FOREVER); -#else - while (bound_sem != 0) { - }; -#endif ret = send_for_time(&ep, SENDING_TIME_MS); if (ret < 0) { @@ -158,7 +124,6 @@ int main(void) return ret; } - LOG_INF("Received %zu [Bytes] in total", received); LOG_INF("IPC-service REMOTE demo ended"); return 0; diff --git a/samples/subsys/ipc/ipc_service/icmsg/sample.yaml b/samples/subsys/ipc/ipc_service/icmsg/sample.yaml index 3df06a80a42..298c41f56db 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/sample.yaml +++ b/samples/subsys/ipc/ipc_service/icmsg/sample.yaml @@ -18,7 +18,6 @@ tests: - "host: Sent" - "host: Received" - "host: IPC-service HOST demo ended" - sample.ipc.icmsg.nrf54l15: platform_allow: nrf54l15pdk/nrf54l15/cpuapp integration_platforms: @@ -27,60 +26,4 @@ tests: extra_args: icmsg_SNIPPET=nordic-flpr sysbuild: true - harness: console - harness_config: - type: multi_line - ordered: false - regex: - - "host: IPC-service HOST demo started" - - "host: Ep bounded" - - "host: Perform sends for" - - "host: Sent" - - "host: Received" - - "host: IPC-service HOST demo ended" - - sample.ipc.icmsg.nrf54l15_no_multithreading: - platform_allow: nrf54l15pdk/nrf54l15/cpuapp - integration_platforms: - - nrf54l15pdk/nrf54l15/cpuapp - tags: ipc - extra_args: - icmsg_SNIPPET=nordic-flpr - icmsg_CONFIG_MULTITHREADING=n - icmsg_CONFIG_LOG_MODE_MINIMAL=y - remote_CONFIG_MULTITHREADING=n - remote_CONFIG_LOG_MODE_MINIMAL=y - sysbuild: true - harness: console - harness_config: - type: multi_line - ordered: false - regex: - - "I: IPC-service HOST demo started" - - "I: Ep bounded" - - "I: Perform sends for" - - "I: Sent" - - "I: Received" - - "I: IPC-service HOST demo ended" - - sample.ipc.icmsg.nrf54l15_remote_no_multithreading: - platform_allow: nrf54l15pdk/nrf54l15/cpuapp - integration_platforms: - - nrf54l15pdk/nrf54l15/cpuapp - tags: ipc - extra_args: - icmsg_SNIPPET=nordic-flpr - remote_CONFIG_MULTITHREADING=n - remote_CONFIG_LOG_MODE_MINIMAL=y - sysbuild: true - harness: console - harness_config: - type: multi_line - ordered: false - regex: - - "host: IPC-service HOST demo started" - - "host: Ep bounded" - - "host: Perform sends for" - - "host: Sent" - - "host: Received" - - "host: IPC-service HOST demo ended" + harness: remote diff --git a/samples/subsys/ipc/ipc_service/icmsg/src/main.c b/samples/subsys/ipc/ipc_service/icmsg/src/main.c index bbc8f103641..a13477aa368 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/src/main.c +++ b/samples/subsys/ipc/ipc_service/icmsg/src/main.c @@ -18,42 +18,29 @@ #include LOG_MODULE_REGISTER(host, LOG_LEVEL_INF); -#if defined(CONFIG_MULTITHREADING) -K_SEM_DEFINE(bound_sem, 0, 1); -#else -volatile uint32_t bound_sem = 1; -volatile uint32_t recv_sem = 1; -#endif +K_SEM_DEFINE(bound_sem, 0, 1); static unsigned char expected_message = 'A'; static size_t expected_len = PACKET_SIZE_START; + static size_t received; static void ep_bound(void *priv) { received = 0; -#if defined(CONFIG_MULTITHREADING) + k_sem_give(&bound_sem); -#else - bound_sem = 0; -#endif LOG_INF("Ep bounded"); } static void ep_recv(const void *data, size_t len, void *priv) { -#if defined(CONFIG_ASSERT) struct data_packet *packet = (struct data_packet *)data; __ASSERT(packet->data[0] == expected_message, "Unexpected message. Expected %c, got %c", expected_message, packet->data[0]); __ASSERT(len == expected_len, "Unexpected length. Expected %zu, got %zu", expected_len, len); -#endif - -#ifndef CONFIG_MULTITHREADING - recv_sem = 0; -#endif received += len; expected_message++; @@ -88,11 +75,6 @@ static int send_for_time(struct ipc_ept *ep, const int64_t sending_time_ms) LOG_ERR("Failed to send (%c) failed with ret %d", msg.data[0], ret); break; } -#if !defined(CONFIG_MULTITHREADING) - else { - recv_sem = 1; - } -#endif msg.data[0]++; if (msg.data[0] > 'z') { @@ -106,12 +88,7 @@ static int send_for_time(struct ipc_ept *ep, const int64_t sending_time_ms) mlen = PACKET_SIZE_START; } -#if defined(CONFIG_MULTITHREADING) k_usleep(1); -#else - while ((recv_sem != 0) && ((k_uptime_get() - start) < sending_time_ms)) { - }; -#endif } LOG_INF("Sent %zu [Bytes] over %lld [ms]", bytes_sent, sending_time_ms); @@ -148,12 +125,7 @@ int main(void) return ret; } -#if defined(CONFIG_MULTITHREADING) k_sem_take(&bound_sem, K_FOREVER); -#else - while (bound_sem != 0) { - }; -#endif ret = send_for_time(&ep, SENDING_TIME_MS); if (ret < 0) { @@ -162,11 +134,7 @@ int main(void) } LOG_INF("Wait 500ms. Let remote core finish its sends"); -#if defined(CONFIG_MULTITHREADING) k_msleep(500); -#else - k_busy_wait(500000); -#endif LOG_INF("Received %zu [Bytes] in total", received); From d16a5a9fb7d599445f991854e4fdbd47d1b9b3b2 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 278/825] Revert "[nrf fromtree] samples: ipc: icmsg: Add received bytes metric" This reverts commit 5616857411cc2fded7a9b761858f3540cdaadb5e. --- samples/subsys/ipc/ipc_service/icmsg/src/main.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/samples/subsys/ipc/ipc_service/icmsg/src/main.c b/samples/subsys/ipc/ipc_service/icmsg/src/main.c index a13477aa368..f864d552e7f 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/src/main.c +++ b/samples/subsys/ipc/ipc_service/icmsg/src/main.c @@ -23,12 +23,8 @@ K_SEM_DEFINE(bound_sem, 0, 1); static unsigned char expected_message = 'A'; static size_t expected_len = PACKET_SIZE_START; -static size_t received; - static void ep_bound(void *priv) { - received = 0; - k_sem_give(&bound_sem); LOG_INF("Ep bounded"); } @@ -42,7 +38,6 @@ static void ep_recv(const void *data, size_t len, void *priv) __ASSERT(len == expected_len, "Unexpected length. Expected %zu, got %zu", expected_len, len); - received += len; expected_message++; expected_len++; @@ -136,8 +131,6 @@ int main(void) LOG_INF("Wait 500ms. Let remote core finish its sends"); k_msleep(500); - LOG_INF("Received %zu [Bytes] in total", received); - #if defined(CONFIG_SOC_NRF5340_CPUAPP) LOG_INF("Stop network core"); nrf53_cpunet_enable(false); From a7beae7fe581034df364140598cf08a09e340908 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 279/825] Revert "[nrf fromlist] samples: mbox: Align to NO MULTITHREADING" This reverts commit 130840c106375d723983e6161f2b18fac3485984. --- samples/drivers/mbox/remote/src/main.c | 9 +++---- samples/drivers/mbox/sample.yaml | 35 -------------------------- samples/drivers/mbox/src/main.c | 4 --- 3 files changed, 3 insertions(+), 45 deletions(-) diff --git a/samples/drivers/mbox/remote/src/main.c b/samples/drivers/mbox/remote/src/main.c index 4ff1a81f5bf..ee2a26c41c3 100644 --- a/samples/drivers/mbox/remote/src/main.c +++ b/samples/drivers/mbox/remote/src/main.c @@ -51,12 +51,6 @@ int main(void) printk("Maximum TX channels: %d\n", mbox_max_channels_get_dt(&tx_channel)); while (1) { -#if defined(CONFIG_MULTITHREADING) - k_sleep(K_MSEC(3000)); -#else - k_busy_wait(3000000); -#endif - printk("Ping (on channel %d)\n", tx_channel.channel_id); ret = mbox_send_dt(&tx_channel, NULL); @@ -64,7 +58,10 @@ int main(void) printk("Could not send (%d)\n", ret); return 0; } + + k_sleep(K_MSEC(3000)); } #endif /* CONFIG_TX_ENABLED */ + return 0; } diff --git a/samples/drivers/mbox/sample.yaml b/samples/drivers/mbox/sample.yaml index 9e1473cc054..01646f040bc 100644 --- a/samples/drivers/mbox/sample.yaml +++ b/samples/drivers/mbox/sample.yaml @@ -82,38 +82,3 @@ tests: regex: - "Ping \\(on channel 16\\)" - "Pong \\(on channel 15\\)" - - sample.drivers.mbox.nrf54l15_no_multithreading: - platform_allow: - - nrf54l15pdk/nrf54l15/cpuapp - integration_platforms: - - nrf54l15pdk/nrf54l15/cpuapp - extra_args: - mbox_SNIPPET=nordic-flpr - mbox_CONFIG_MULTITHREADING=n - remote_CONFIG_MULTITHREADING=n - sysbuild: true - harness: console - harness_config: - type: multi_line - ordered: false - regex: - - "Ping \\(on channel 16\\)" - - "Pong \\(on channel 15\\)" - - sample.drivers.mbox.nrf54l15_remote_no_multithreading: - platform_allow: - - nrf54l15pdk/nrf54l15/cpuapp - integration_platforms: - - nrf54l15pdk/nrf54l15/cpuapp - extra_args: - mbox_SNIPPET=nordic-flpr - remote_CONFIG_MULTITHREADING=n - sysbuild: true - harness: console - harness_config: - type: multi_line - ordered: false - regex: - - "Ping \\(on channel 16\\)" - - "Pong \\(on channel 15\\)" diff --git a/samples/drivers/mbox/src/main.c b/samples/drivers/mbox/src/main.c index 33430dcdd19..bf9690c868f 100644 --- a/samples/drivers/mbox/src/main.c +++ b/samples/drivers/mbox/src/main.c @@ -47,11 +47,7 @@ int main(void) printk("Maximum TX channels: %d\n", mbox_max_channels_get_dt(&tx_channel)); while (1) { -#if defined(CONFIG_MULTITHREADING) k_sleep(K_MSEC(2000)); -#else - k_busy_wait(2000000); -#endif printk("Ping (on channel %d)\n", tx_channel.channel_id); From 827063875a5cfc475b5cd355404a16c69c19e75c Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 280/825] Revert "[nrf fromlist] ipc: icmsg: Align to NO MULTITHREADING" This reverts commit b9de46585ee93320698f8df3bc4626b5adc918b9. --- include/zephyr/ipc/icmsg.h | 2 - subsys/ipc/ipc_service/lib/Kconfig.icmsg | 2 - subsys/ipc/ipc_service/lib/icmsg.c | 96 ++++-------------------- 3 files changed, 14 insertions(+), 86 deletions(-) diff --git a/include/zephyr/ipc/icmsg.h b/include/zephyr/ipc/icmsg.h index 9a04aa980a0..80e3412095a 100644 --- a/include/zephyr/ipc/icmsg.h +++ b/include/zephyr/ipc/icmsg.h @@ -51,10 +51,8 @@ struct icmsg_data_t { /* General */ const struct icmsg_config_t *cfg; -#ifdef CONFIG_MULTITHREADING struct k_work_delayable notify_work; struct k_work mbox_work; -#endif atomic_t state; }; diff --git a/subsys/ipc/ipc_service/lib/Kconfig.icmsg b/subsys/ipc/ipc_service/lib/Kconfig.icmsg index 7a9a93e86de..39b8c8d0c75 100644 --- a/subsys/ipc/ipc_service/lib/Kconfig.icmsg +++ b/subsys/ipc/ipc_service/lib/Kconfig.icmsg @@ -3,7 +3,6 @@ config IPC_SERVICE_ICMSG_SHMEM_ACCESS_SYNC bool "Synchronize access to shared memory" - depends on MULTITHREADING default y help Provide synchronization access to shared memory at a library level. @@ -31,7 +30,6 @@ config IPC_SERVICE_ICMSG_BOND_NOTIFY_REPEAT_TO_MS config IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE bool "Use dedicated workqueue" - depends on MULTITHREADING default y help Enable dedicated workqueue thread for the ICMsg backend. diff --git a/subsys/ipc/ipc_service/lib/icmsg.c b/subsys/ipc/ipc_service/lib/icmsg.c index 37d923ce688..61fa03689f4 100644 --- a/subsys/ipc/ipc_service/lib/icmsg.c +++ b/subsys/ipc/ipc_service/lib/icmsg.c @@ -15,10 +15,10 @@ #define BOND_NOTIFY_REPEAT_TO K_MSEC(CONFIG_IPC_SERVICE_ICMSG_BOND_NOTIFY_REPEAT_TO_MS) #define SHMEM_ACCESS_TO K_MSEC(CONFIG_IPC_SERVICE_ICMSG_SHMEM_ACCESS_TO_MS) + static const uint8_t magic[] = {0x45, 0x6d, 0x31, 0x6c, 0x31, 0x4b, 0x30, 0x72, 0x6e, 0x33, 0x6c, 0x69, 0x34}; -#ifdef CONFIG_MULTITHREADING #if IS_ENABLED(CONFIG_IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE) static K_THREAD_STACK_DEFINE(icmsg_stack, CONFIG_IPC_SERVICE_BACKEND_ICMSG_WQ_STACK_SIZE); static struct k_work_q icmsg_workq; @@ -26,10 +26,6 @@ static struct k_work_q *const workq = &icmsg_workq; #else static struct k_work_q *const workq = &k_sys_work_q; #endif -static void mbox_callback_process(struct k_work *item); -#else -static void mbox_callback_process(struct icmsg_data_t *dev_data); -#endif static int mbox_deinit(const struct icmsg_config_t *conf, struct icmsg_data_t *dev_data) @@ -46,20 +42,12 @@ static int mbox_deinit(const struct icmsg_config_t *conf, return err; } -#ifdef CONFIG_MULTITHREADING (void)k_work_cancel(&dev_data->mbox_work); (void)k_work_cancel_delayable(&dev_data->notify_work); -#endif return 0; } -static bool is_endpoint_ready(struct icmsg_data_t *dev_data) -{ - return atomic_get(&dev_data->state) == ICMSG_STATE_READY; -} - -#ifdef CONFIG_MULTITHREADING static void notify_process(struct k_work *item) { struct k_work_delayable *dwork = k_work_delayable_from_work(item); @@ -78,53 +66,37 @@ static void notify_process(struct k_work *item) (void)ret; } } -#else -static void notify_process(struct icmsg_data_t *dev_data) -{ - (void)mbox_send_dt(&dev_data->cfg->mbox_tx, NULL); -#if defined(CONFIG_SYS_CLOCK_EXISTS) - int64_t start = k_uptime_get(); -#endif - - while (false == is_endpoint_ready(dev_data)) { - mbox_callback_process(dev_data); -#if defined(CONFIG_SYS_CLOCK_EXISTS) - if ((k_uptime_get() - start) > CONFIG_IPC_SERVICE_ICMSG_BOND_NOTIFY_REPEAT_TO_MS) { -#endif - (void)mbox_send_dt(&dev_data->cfg->mbox_tx, NULL); -#if defined(CONFIG_SYS_CLOCK_EXISTS) - start = k_uptime_get(); - }; -#endif - } +static bool is_endpoint_ready(struct icmsg_data_t *dev_data) +{ + return atomic_get(&dev_data->state) == ICMSG_STATE_READY; } -#endif -#ifdef CONFIG_IPC_SERVICE_ICMSG_SHMEM_ACCESS_SYNC static int reserve_tx_buffer_if_unused(struct icmsg_data_t *dev_data) { +#ifdef CONFIG_IPC_SERVICE_ICMSG_SHMEM_ACCESS_SYNC int ret = k_mutex_lock(&dev_data->tx_lock, SHMEM_ACCESS_TO); if (ret < 0) { return ret; } - +#endif return 0; } static int release_tx_buffer(struct icmsg_data_t *dev_data) { +#ifdef CONFIG_IPC_SERVICE_ICMSG_SHMEM_ACCESS_SYNC return k_mutex_unlock(&dev_data->tx_lock); -} #endif + return 0; +} static uint32_t data_available(struct icmsg_data_t *dev_data) { return pbuf_read(dev_data->rx_pb, NULL, 0); } -#ifdef CONFIG_MULTITHREADING static void submit_mbox_work(struct icmsg_data_t *dev_data) { if (k_work_submit_to_queue(workq, &dev_data->mbox_work) < 0) { @@ -149,33 +121,10 @@ static void submit_work_if_buffer_free_and_data_available( submit_mbox_work(dev_data); } -#else -static void submit_if_buffer_free(struct icmsg_data_t *dev_data) -{ - mbox_callback_process(dev_data); -} - -static void submit_if_buffer_free_and_data_available( - struct icmsg_data_t *dev_data) -{ - - if (!data_available(dev_data)) { - return; - } - - mbox_callback_process(dev_data); -} -#endif -#ifdef CONFIG_MULTITHREADING static void mbox_callback_process(struct k_work *item) -#else -static void mbox_callback_process(struct icmsg_data_t *dev_data) -#endif { -#ifdef CONFIG_MULTITHREADING struct icmsg_data_t *dev_data = CONTAINER_OF(item, struct icmsg_data_t, mbox_work); -#endif atomic_t state = atomic_get(&dev_data->state); @@ -192,7 +141,8 @@ static void mbox_callback_process(struct icmsg_data_t *dev_data) if (state == ICMSG_STATE_READY) { if (dev_data->cb->received) { - dev_data->cb->received(rx_buffer, len, dev_data->ctx); + dev_data->cb->received(rx_buffer, len, + dev_data->ctx); } } else { __ASSERT_NO_MSG(state == ICMSG_STATE_BUSY); @@ -212,22 +162,15 @@ static void mbox_callback_process(struct icmsg_data_t *dev_data) atomic_set(&dev_data->state, ICMSG_STATE_READY); } -#ifdef CONFIG_MULTITHREADING + submit_work_if_buffer_free_and_data_available(dev_data); -#else - submit_if_buffer_free_and_data_available(dev_data); -#endif } static void mbox_callback(const struct device *instance, uint32_t channel, void *user_data, struct mbox_msg *msg_data) { struct icmsg_data_t *dev_data = user_data; -#ifdef CONFIG_MULTITHREADING submit_work_if_buffer_free(dev_data); -#else - submit_if_buffer_free(dev_data); -#endif } static int mbox_init(const struct icmsg_config_t *conf, @@ -235,10 +178,8 @@ static int mbox_init(const struct icmsg_config_t *conf, { int err; -#ifdef CONFIG_MULTITHREADING k_work_init(&dev_data->mbox_work, mbox_callback_process); k_work_init_delayable(&dev_data->notify_work, notify_process); -#endif err = mbox_register_callback_dt(&conf->mbox_rx, mbox_callback, dev_data); if (err != 0) { @@ -292,14 +233,12 @@ int icmsg_open(const struct icmsg_config_t *conf, if (ret) { return ret; } -#ifdef CONFIG_MULTITHREADING + ret = k_work_schedule_for_queue(workq, &dev_data->notify_work, K_NO_WAIT); if (ret < 0) { return ret; } -#else - notify_process(dev_data); -#endif + return 0; } @@ -324,9 +263,7 @@ int icmsg_send(const struct icmsg_config_t *conf, { int ret; int write_ret; -#ifdef CONFIG_IPC_SERVICE_ICMSG_SHMEM_ACCESS_SYNC int release_ret; -#endif int sent_bytes; if (!is_endpoint_ready(dev_data)) { @@ -338,19 +275,14 @@ int icmsg_send(const struct icmsg_config_t *conf, return -ENODATA; } -#ifdef CONFIG_IPC_SERVICE_ICMSG_SHMEM_ACCESS_SYNC ret = reserve_tx_buffer_if_unused(dev_data); if (ret < 0) { return -ENOBUFS; } -#endif write_ret = pbuf_write(dev_data->tx_pb, msg, len); - -#ifdef CONFIG_IPC_SERVICE_ICMSG_SHMEM_ACCESS_SYNC release_ret = release_tx_buffer(dev_data); __ASSERT_NO_MSG(!release_ret); -#endif if (write_ret < 0) { return write_ret; From dc1a5b0232bffafa51f646dc7181731717ca3024 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 281/825] Revert "[nrf fromtree] arch: riscv: core: Enable RISCV IRQs for no multithreading" This reverts commit 1e7a13b9072bd297eb46c5f2b5fb23f4ce8bc722. --- arch/riscv/core/thread.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/riscv/core/thread.c b/arch/riscv/core/thread.c index de739f02895..38d5dbde092 100644 --- a/arch/riscv/core/thread.c +++ b/arch/riscv/core/thread.c @@ -212,8 +212,6 @@ FUNC_NORETURN void z_riscv_switch_to_main_no_multithreading(k_thread_entry_t mai main_stack = (K_THREAD_STACK_BUFFER(z_main_stack) + K_THREAD_STACK_SIZEOF(z_main_stack)); - irq_unlock(MSTATUS_IEN); - __asm__ volatile ( "mv sp, %0; jalr ra, %1, 0" : From c7a827e9edef1a9e5a801b3ee0712c53ecd4e928 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 282/825] Revert "[nrf fromtree] net: ipv6: scope checking function fix" This reverts commit 85665b2d994d973f3ccb6909a0b9fc8d5d52f8f2. --- include/zephyr/net/net_ip.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/zephyr/net/net_ip.h b/include/zephyr/net/net_ip.h index 4764ba94456..413d3efb094 100644 --- a/include/zephyr/net/net_ip.h +++ b/include/zephyr/net/net_ip.h @@ -1122,7 +1122,7 @@ static inline bool net_ipv6_is_addr_solicited_node(const struct in6_addr *addr) static inline bool net_ipv6_is_addr_mcast_scope(const struct in6_addr *addr, int scope) { - return (addr->s6_addr[0] == 0xff) && ((addr->s6_addr[1] & 0xF) == scope); + return (addr->s6_addr[0] == 0xff) && (addr->s6_addr[1] == scope); } /** From cf83ca41e22f25698967937a8865131057173c2b Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 283/825] Revert "[nrf fromtree] net: ipv6: mcast_routing: hop limit handling" This reverts commit 2fbc694d07147f19f53d91810b849833be56f188. --- subsys/net/ip/ipv6.c | 13 +++++-------- subsys/net/ip/route.c | 9 ++------- subsys/net/ip/route.h | 2 +- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/subsys/net/ip/ipv6.c b/subsys/net/ip/ipv6.c index 017987aa006..7b186680d51 100644 --- a/subsys/net/ip/ipv6.c +++ b/subsys/net/ip/ipv6.c @@ -411,15 +411,12 @@ static enum net_verdict ipv6_forward_mcast_packet(struct net_pkt *pkt, #if defined(CONFIG_NET_ROUTE_MCAST) int routed; - /* Continue processing without forwarding if: - * 1. routing loop could be created - * 2. the destination is of interface local scope - * 3. is from link local source - * 4. hop limit is or would become zero + /* check if routing loop could be created or if the destination is of + * interface local scope or if from link local source */ - if (net_ipv6_is_addr_mcast((struct in6_addr *)hdr->src) || - net_ipv6_is_addr_mcast_iface((struct in6_addr *)hdr->dst) || - net_ipv6_is_ll_addr((struct in6_addr *)hdr->src) || hdr->hop_limit <= 1) { + if (net_ipv6_is_addr_mcast((struct in6_addr *)hdr->src) || + net_ipv6_is_addr_mcast_iface((struct in6_addr *)hdr->dst) || + net_ipv6_is_ll_addr((struct in6_addr *)hdr->src)) { return NET_CONTINUE; } diff --git a/subsys/net/ip/route.c b/subsys/net/ip/route.c index 43a754556e1..09f71c5b179 100644 --- a/subsys/net/ip/route.c +++ b/subsys/net/ip/route.c @@ -815,16 +815,11 @@ static void propagate_mld_event(struct net_route_entry_mcast *route, bool route_ #define propagate_mld_event(...) #endif /* CONFIG_NET_MCAST_ROUTE_MLD_REPORTS */ -int net_route_mcast_forward_packet(struct net_pkt *pkt, struct net_ipv6_hdr *hdr) +int net_route_mcast_forward_packet(struct net_pkt *pkt, + const struct net_ipv6_hdr *hdr) { int ret = 0, err = 0; - /* At this point, the original pkt has already stored the hop limit in its metadata. - * Change its value in a common buffer so the forwardee has a proper count. As we have - * a direct access to the buffer there is no need to perform read/write operations. - */ - hdr->hop_limit--; - ARRAY_FOR_EACH_PTR(route_mcast_entries, route) { struct net_pkt *pkt_cpy = NULL; diff --git a/subsys/net/ip/route.h b/subsys/net/ip/route.h index d8e4647f62d..e6dc4a1aac9 100644 --- a/subsys/net/ip/route.h +++ b/subsys/net/ip/route.h @@ -224,7 +224,7 @@ typedef void (*net_route_mcast_cb_t)(struct net_route_entry_mcast *entry, * value in case of an error. */ int net_route_mcast_forward_packet(struct net_pkt *pkt, - struct net_ipv6_hdr *hdr); + const struct net_ipv6_hdr *hdr); /** * @brief Go through all the multicast routing entries and call callback From 8d430ff70414578fb03a3e33c83441cb0592ebe1 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 284/825] Revert "[nrf fromlist] tests: net: sockets: misc: Fix SO_BINDTODEVICE test" This reverts commit 4c996ecd07e576524a98405b2af6c01c56cb83e5. --- tests/net/socket/misc/src/main.c | 62 +++++++++++++++----------------- 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/tests/net/socket/misc/src/main.c b/tests/net/socket/misc/src/main.c index 32b0430aeab..1ddc872ce3b 100644 --- a/tests/net/socket/misc/src/main.c +++ b/tests/net/socket/misc/src/main.c @@ -166,9 +166,9 @@ NET_DEVICE_INIT(dummy_2, DEV2_NAME, NULL, NULL, &dummy_data2, NULL, #define DST_PORT 4242 #define BIND_PORT 4240 -void test_so_bindtodevice(int sock_c, int sock_s, struct sockaddr *peer_addr_1, - struct sockaddr *peer_addr_2, socklen_t peer_addrlen, - struct sockaddr *bind_addr, socklen_t bind_addrlen) +void test_so_bindtodevice(int sock_c, int sock_s, struct sockaddr *peer_addr, + socklen_t peer_addrlen, struct sockaddr *bind_addr, + socklen_t bind_addrlen) { int ret; struct ifreq ifreq = { 0 }; @@ -203,7 +203,7 @@ void test_so_bindtodevice(int sock_c, int sock_s, struct sockaddr *peer_addr_1, zassert_equal(ret, 0, "SO_BINDTODEVICE failed, %d", errno); ret = zsock_sendto(sock_c, send_buf, strlen(send_buf) + 1, 0, - peer_addr_1, peer_addrlen); + peer_addr, peer_addrlen); zassert_equal(ret, strlen(send_buf) + 1, "sendto failed, %d", errno); ret = sys_sem_take(&send_sem, K_MSEC(100)); @@ -228,7 +228,7 @@ void test_so_bindtodevice(int sock_c, int sock_s, struct sockaddr *peer_addr_1, zassert_equal(ret, 0, "SO_BINDTODEVICE failed, %d", errno); ret = zsock_sendto(sock_c, send_buf, strlen(send_buf) + 1, 0, - peer_addr_2, peer_addrlen); + peer_addr, peer_addrlen); zassert_equal(ret, strlen(send_buf) + 1, "sendto failed, %d", errno); ret = sys_sem_take(&send_sem, K_MSEC(100)); @@ -266,7 +266,7 @@ void test_so_bindtodevice(int sock_c, int sock_s, struct sockaddr *peer_addr_1, zassert_equal(ret, 0, "SO_BINDTODEVICE failed, %d", errno); ret = zsock_sendto(sock_c, send_buf, strlen(send_buf) + 1, 0, - peer_addr_1, peer_addrlen); + peer_addr, peer_addrlen); zassert_equal(ret, strlen(send_buf) + 1, "sendto failed, %d", errno); ret = sys_sem_take(&send_sem, K_MSEC(100)); @@ -295,18 +295,10 @@ void test_so_bindtodevice(int sock_c, int sock_s, struct sockaddr *peer_addr_1, void test_ipv4_so_bindtodevice(void) { + int ret; int sock_c; int sock_s; - struct sockaddr_in peer_addr_1 = { - .sin_family = AF_INET, - .sin_port = htons(DST_PORT), - .sin_addr = { { { 192, 0, 2, 1 } } }, - }; - struct sockaddr_in peer_addr_2 = { - .sin_family = AF_INET, - .sin_port = htons(DST_PORT), - .sin_addr = { { { 192, 0, 2, 2 } } }, - }; + struct sockaddr_in peer_addr; struct sockaddr_in bind_addr = { .sin_family = AF_INET, .sin_port = htons(DST_PORT), @@ -318,27 +310,23 @@ void test_ipv4_so_bindtodevice(void) sock_s = zsock_socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); zassert_true(sock_s >= 0, "socket open failed"); - test_so_bindtodevice(sock_c, sock_s, (struct sockaddr *)&peer_addr_1, - (struct sockaddr *)&peer_addr_2, sizeof(peer_addr_1), - (struct sockaddr *)&bind_addr, sizeof(bind_addr)); + peer_addr.sin_family = AF_INET; + peer_addr.sin_port = htons(DST_PORT); + ret = zsock_inet_pton(AF_INET, TEST_PEER_IPV4_ADDR, + &peer_addr.sin_addr); + zassert_equal(ret, 1, "inet_pton failed"); + + test_so_bindtodevice(sock_c, sock_s, (struct sockaddr *)&peer_addr, + sizeof(peer_addr), (struct sockaddr *)&bind_addr, + sizeof(bind_addr)); } void test_ipv6_so_bindtodevice(void) { + int ret; int sock_c; int sock_s; - struct sockaddr_in6 peer_addr_1 = { - .sin6_family = AF_INET6, - .sin6_port = htons(DST_PORT), - .sin6_addr = { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0x1 } } }, - }; - struct sockaddr_in6 peer_addr_2 = { - .sin6_family = AF_INET6, - .sin6_port = htons(DST_PORT), - .sin6_addr = { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0x2 } } }, - }; + struct sockaddr_in6 peer_addr; struct sockaddr_in6 bind_addr = { .sin6_family = AF_INET6, .sin6_port = htons(DST_PORT), @@ -350,9 +338,15 @@ void test_ipv6_so_bindtodevice(void) sock_s = zsock_socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); zassert_true(sock_s >= 0, "socket open failed"); - test_so_bindtodevice(sock_c, sock_s, (struct sockaddr *)&peer_addr_1, - (struct sockaddr *)&peer_addr_2, sizeof(peer_addr_1), - (struct sockaddr *)&bind_addr, sizeof(bind_addr)); + peer_addr.sin6_family = AF_INET6; + peer_addr.sin6_port = htons(DST_PORT); + ret = zsock_inet_pton(AF_INET6, TEST_PEER_IPV6_ADDR, + &peer_addr.sin6_addr); + zassert_equal(ret, 1, "inet_pton failed"); + + test_so_bindtodevice(sock_c, sock_s, (struct sockaddr *)&peer_addr, + sizeof(peer_addr), (struct sockaddr *)&bind_addr, + sizeof(bind_addr)); } #define ADDR_SIZE(family) ((family == AF_INET) ? \ From 78b22cd28e4bea945725f69c26ae82201cfbbb42 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 285/825] Revert "[nrf fromlist] net: ipv6: routing: move checking for an own source address" This reverts commit 8587f90382badfdc3a251e609ec4de62a95d7e4c. --- subsys/net/ip/ipv6.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/subsys/net/ip/ipv6.c b/subsys/net/ip/ipv6.c index 7b186680d51..2ff1ca3103a 100644 --- a/subsys/net/ip/ipv6.c +++ b/subsys/net/ip/ipv6.c @@ -449,18 +449,6 @@ static uint8_t extension_to_bitmap(uint8_t header, uint8_t ext_bitmap) } } -static inline bool is_src_non_tentative_itself(struct in6_addr *src) -{ - struct net_if_addr *ifaddr; - - ifaddr = net_if_ipv6_addr_lookup(src, NULL); - if (ifaddr != NULL && ifaddr->addr_state != NET_ADDR_TENTATIVE) { - return true; - } - - return false; -} - enum net_verdict net_ipv6_input(struct net_pkt *pkt, bool is_loopback) { NET_PKT_DATA_ACCESS_CONTIGUOUS_DEFINE(ipv6_access, struct net_ipv6_hdr); @@ -517,6 +505,8 @@ enum net_verdict net_ipv6_input(struct net_pkt *pkt, bool is_loopback) } if (!is_loopback) { + struct net_if_addr *ifaddr; + if (net_ipv6_is_addr_loopback((struct in6_addr *)hdr->dst) || net_ipv6_is_addr_loopback((struct in6_addr *)hdr->src)) { NET_DBG("DROP: ::1 packet"); @@ -536,10 +526,9 @@ enum net_verdict net_ipv6_input(struct net_pkt *pkt, bool is_loopback) /* We need to pass the packet through in case our address is * tentative, as receiving a packet with a tentative address as * source means that duplicate address has been detected. - * This check is done later on if routing features are enabled. */ - if (!IS_ENABLED(CONFIG_NET_ROUTING) && !IS_ENABLED(CONFIG_NET_ROUTE_MCAST) && - is_src_non_tentative_itself((struct in6_addr *)hdr->src)) { + ifaddr = net_if_ipv6_addr_lookup((struct in6_addr *)hdr->src, NULL); + if (ifaddr != NULL && ifaddr->addr_state != NET_ADDR_TENTATIVE) { NET_DBG("DROP: src addr is %s", "mine"); goto drop; } @@ -604,12 +593,6 @@ enum net_verdict net_ipv6_input(struct net_pkt *pkt, bool is_loopback) } } - if ((IS_ENABLED(CONFIG_NET_ROUTING) || IS_ENABLED(CONFIG_NET_ROUTE_MCAST)) && - !is_loopback && is_src_non_tentative_itself((struct in6_addr *)hdr->src)) { - NET_DBG("DROP: src addr is %s", "mine"); - goto drop; - } - if (net_ipv6_is_addr_mcast((struct in6_addr *)hdr->dst) && !(net_ipv6_is_addr_mcast_iface((struct in6_addr *)hdr->dst) || net_ipv6_is_addr_mcast_link_all_nodes((struct in6_addr *)hdr->dst))) { From 61325bd5b0e59305e8ad3efa5a6f10479aa493ae Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 286/825] Revert "[nrf fromlist] net: ipv6: routing: do not loop back already routed packets" This reverts commit 8968b029ba9d4f978bd4ad4dd14c5125a93cefed. --- subsys/net/ip/net_core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/subsys/net/ip/net_core.c b/subsys/net/ip/net_core.c index 3ed62a55bc1..cc2356cdf64 100644 --- a/subsys/net/ip/net_core.c +++ b/subsys/net/ip/net_core.c @@ -255,13 +255,12 @@ static inline int check_ip(struct net_pkt *pkt) } /* If the destination address is our own, then route it - * back to us (if it is not already forwarded). + * back to us. */ - if ((net_ipv6_is_addr_loopback( + if (net_ipv6_is_addr_loopback( (struct in6_addr *)NET_IPV6_HDR(pkt)->dst) || net_ipv6_is_my_addr( - (struct in6_addr *)NET_IPV6_HDR(pkt)->dst)) && - !net_pkt_forwarding(pkt)) { + (struct in6_addr *)NET_IPV6_HDR(pkt)->dst)) { struct in6_addr addr; /* Swap the addresses so that in receiving side From c799a0448d63d17d0942dd937a9d48ae286ff0be Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 287/825] Revert "[nrf fromlist] net: ipv6: routing: do not use an original source address for NS" This reverts commit bdb96410d9dcd231298fb9c6d60a6cd3a91fcff1. --- subsys/net/ip/ipv6_nbr.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/subsys/net/ip/ipv6_nbr.c b/subsys/net/ip/ipv6_nbr.c index 41aeb4c681d..aea731dade8 100644 --- a/subsys/net/ip/ipv6_nbr.c +++ b/subsys/net/ip/ipv6_nbr.c @@ -950,12 +950,10 @@ enum net_verdict net_ipv6_prepare_for_send(struct net_pkt *pkt) net_ipv6_nbr_unlock(); #if defined(CONFIG_NET_IPV6_ND) - /* We need to send NS and wait for NA before sending the packet. If the packet was - * forwarded from another interface do not use the original source address. - */ + /* We need to send NS and wait for NA before sending the packet. */ ret = net_ipv6_send_ns(net_pkt_iface(pkt), pkt, - net_pkt_forwarding(pkt) ? NULL : (struct in6_addr *)ip_hdr->src, - NULL, nexthop, false); + (struct in6_addr *)ip_hdr->src, NULL, nexthop, + false); if (ret < 0) { /* In case of an error, the NS send function will unref * the pkt. From 6cf9d4b86e735ffddababfa265c82ebb7587baf6 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 288/825] Revert "[nrf fromlist] net: ipv6: routing: match destination address to a given interface" This reverts commit 2aa52337b4c6ba64ddeb397ab5e8fe18730fb7ec. --- subsys/net/ip/ipv6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/net/ip/ipv6.c b/subsys/net/ip/ipv6.c index 2ff1ca3103a..9d094c9c4c9 100644 --- a/subsys/net/ip/ipv6.c +++ b/subsys/net/ip/ipv6.c @@ -570,7 +570,7 @@ enum net_verdict net_ipv6_input(struct net_pkt *pkt, bool is_loopback) } if (!net_ipv6_is_addr_mcast((struct in6_addr *)hdr->dst)) { - if (!net_if_ipv6_addr_lookup_by_iface(pkt_iface, (struct in6_addr *)hdr->dst)) { + if (!net_ipv6_is_my_addr((struct in6_addr *)hdr->dst)) { if (ipv6_route_packet(pkt, hdr) == NET_OK) { return NET_OK; } From ee25775c35571d0111c66fd8196f5089dca6f5c9 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 289/825] Revert "[nrf fromlist] tests: drivers: adc_accuracy: parametrize expected accuracy" This reverts commit c580a48f49273465676e719a2c86cb3d2c074d6b. --- tests/drivers/adc/adc_accuracy_test/boards/frdm_kl25z.overlay | 1 - .../adc/adc_accuracy_test/boards/nrf52840dk_nrf52840.overlay | 1 - .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 1 - .../boards/nrf54l15pdk_nrf54l15_cpuapp.overlay | 1 - tests/drivers/adc/adc_accuracy_test/src/ref_volt.c | 3 +-- 5 files changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/drivers/adc/adc_accuracy_test/boards/frdm_kl25z.overlay b/tests/drivers/adc/adc_accuracy_test/boards/frdm_kl25z.overlay index 3be90387270..148ecda4535 100644 --- a/tests/drivers/adc/adc_accuracy_test/boards/frdm_kl25z.overlay +++ b/tests/drivers/adc/adc_accuracy_test/boards/frdm_kl25z.overlay @@ -8,7 +8,6 @@ zephyr,user { io-channels = <&adc0 12>; reference_mv = <1100>; - expected_accuracy = <32>; }; }; diff --git a/tests/drivers/adc/adc_accuracy_test/boards/nrf52840dk_nrf52840.overlay b/tests/drivers/adc/adc_accuracy_test/boards/nrf52840dk_nrf52840.overlay index 08aa282bc60..85a8c6880c9 100644 --- a/tests/drivers/adc/adc_accuracy_test/boards/nrf52840dk_nrf52840.overlay +++ b/tests/drivers/adc/adc_accuracy_test/boards/nrf52840dk_nrf52840.overlay @@ -9,7 +9,6 @@ zephyr,user { io-channels = <&adc 0>; reference_mv = <3000>; - expected_accuracy = <32>; }; }; diff --git a/tests/drivers/adc/adc_accuracy_test/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/adc/adc_accuracy_test/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index f6ee92720ca..20bd3110aff 100644 --- a/tests/drivers/adc/adc_accuracy_test/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/adc/adc_accuracy_test/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -8,7 +8,6 @@ zephyr,user { io-channels = <&adc 0>; reference_mv = <1800>; - expected_accuracy = <64>; }; }; diff --git a/tests/drivers/adc/adc_accuracy_test/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/tests/drivers/adc/adc_accuracy_test/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay index 53facf3dc31..950c52047f6 100644 --- a/tests/drivers/adc/adc_accuracy_test/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/adc/adc_accuracy_test/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -8,7 +8,6 @@ zephyr,user { io-channels = <&adc 0>; reference_mv = <1800>; - expected_accuracy = <64>; }; }; diff --git a/tests/drivers/adc/adc_accuracy_test/src/ref_volt.c b/tests/drivers/adc/adc_accuracy_test/src/ref_volt.c index 66eaddd5b03..1c4806b249e 100644 --- a/tests/drivers/adc/adc_accuracy_test/src/ref_volt.c +++ b/tests/drivers/adc/adc_accuracy_test/src/ref_volt.c @@ -8,7 +8,6 @@ #include #define REF_V DT_PROP(DT_PATH(zephyr_user), reference_mv) -#define EXP_ACC DT_PROP(DT_PATH(zephyr_user), expected_accuracy) extern const struct adc_dt_spec *get_adc_channel(void); @@ -32,7 +31,7 @@ static int test_ref_to_adc(void) ret = adc_raw_to_millivolts_dt(adc_channel, &sample_buffer); zassert_equal(ret, 0, "adc_raw_to_millivolts_dt() failed with code %d", ret); - zassert_within(sample_buffer, REF_V, EXP_ACC, + zassert_within(sample_buffer, REF_V, 32, "Value %d mV read from ADC does not match expected range (%d mV).", sample_buffer, REF_V); From 6ea7b18309f9c623c4ef05e900bd39a70f8386bc Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 290/825] Revert "[nrf fromlist] tests: drivers: nrf_grtc: Add nRF54H20 PPR target" This reverts commit d430bfa60f4aa3bf874bd2b92e7a29c72ed6f78f. --- tests/drivers/timer/nrf_grtc_timer/testcase.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml index 4b44d495f1f..e81a37cbd2a 100644 --- a/tests/drivers/timer/nrf_grtc_timer/testcase.yaml +++ b/tests/drivers/timer/nrf_grtc_timer/testcase.yaml @@ -6,4 +6,3 @@ tests: - nrf54l15pdk/nrf54l15/cpuflpr - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpurad - - nrf54h20dk/nrf54h20/cpuppr From b3b4c916aec3f01bead64e00fc6cdbd878f12cc0 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 291/825] Revert "[nrf fromlist] net: l2: openthread: set multicast loop by default" This reverts commit f226bb8ce7c601488e6e6687d74df0efb83603c7. --- modules/openthread/platform/radio.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/modules/openthread/platform/radio.c b/modules/openthread/platform/radio.c index 7e2943e734f..49b4a51b79e 100644 --- a/modules/openthread/platform/radio.c +++ b/modules/openthread/platform/radio.c @@ -560,13 +560,6 @@ static void openthread_handle_frame_to_send(otInstance *instance, struct net_pkt goto exit; } - if (IS_ENABLED(CONFIG_OPENTHREAD)) { - /* Set multicast loop so the stack can process multicast packets for - * subscribed addresses. - */ - otMessageSetMulticastLoopEnabled(message, true); - } - for (buf = pkt->buffer; buf; buf = buf->frags) { if (otMessageAppend(message, buf->data, buf->len) != OT_ERROR_NONE) { NET_ERR("Error while appending to otMessage"); From c2ae003a34754f44e4d2da4e5cfbe00c3f2ba28f Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 292/825] Revert "[nrf fromlist] net: openthread: Set CIDR for NAT64" This reverts commit 86c19bdd9f60afc3548a178f2622f59db905cdb8. --- modules/openthread/Kconfig.thread | 10 ---------- subsys/net/l2/openthread/openthread.c | 14 ++------------ 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/modules/openthread/Kconfig.thread b/modules/openthread/Kconfig.thread index 021393fb371..542992e7fa1 100644 --- a/modules/openthread/Kconfig.thread +++ b/modules/openthread/Kconfig.thread @@ -194,13 +194,3 @@ config OPENTHREAD_BLE_TCAT_RING_BUF_SIZE default 512 help Openthread BLE TCAT ringbuffer size. - -config OPENTHREAD_NAT64_CIDR - string "Set IPv4 CIDR used by NAT64" - default "192.168.255.0/24" - depends on OPENTHREAD_BORDER_ROUTING && OPENTHREAD_NAT64_TRANSLATOR - help - Set the IPv4 CIDR (Classless Inter-Domain Routing) used by NAT64 - to set source address of the outgoing translated IPv4 packets. - The CIDR must have four bytes in the address with the - non-zero length of prefix (e.g., "127.0.0.1/24"). diff --git a/subsys/net/l2/openthread/openthread.c b/subsys/net/l2/openthread/openthread.c index 88a6a6c6fd9..c54f2bf5019 100644 --- a/subsys/net/l2/openthread/openthread.c +++ b/subsys/net/l2/openthread/openthread.c @@ -556,18 +556,8 @@ static int openthread_init(struct net_if *iface) #if defined(CONFIG_OPENTHREAD_NAT64_TRANSLATOR) - otIp4Cidr nat64_cidr; - - if (otIp4CidrFromString(CONFIG_OPENTHREAD_NAT64_CIDR, &nat64_cidr) == - OT_ERROR_NONE) { - if (otNat64SetIp4Cidr(openthread_get_default_instance(), &nat64_cidr) != - OT_ERROR_NONE) { - NET_ERR("Incorrect NAT64 CIDR"); - } - } else { - NET_ERR("Failed to parse NAT64 CIDR"); - } - otNat64SetReceiveIp4Callback(ot_context->instance, ot_receive_handler, ot_context); + otNat64SetReceiveIp4Callback(ot_context->instance, + ot_receive_handler, ot_context); #endif /* CONFIG_OPENTHREAD_NAT64_TRANSLATOR */ From 319afc4f75f8ee2ea7c3e3242b0046dd7e8708c1 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 293/825] Revert "[nrf fromlist] net: openthread: Add NAT64 send and receive callbacks." This reverts commit 7a8858ffbec02ce14ca7040580b5ef69be303a7c. --- modules/openthread/platform/radio.c | 54 ++++----------------------- subsys/net/l2/openthread/openthread.c | 32 +--------------- 2 files changed, 10 insertions(+), 76 deletions(-) diff --git a/modules/openthread/platform/radio.c b/modules/openthread/platform/radio.c index 49b4a51b79e..0ed9aea4120 100644 --- a/modules/openthread/platform/radio.c +++ b/modules/openthread/platform/radio.c @@ -38,12 +38,6 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_OPENTHREAD_L2_LOG_LEVEL); #include "platform-zephyr.h" -#if defined(CONFIG_OPENTHREAD_NAT64_TRANSLATOR) -#include -#endif - -#define PKT_IS_IPv6(_p) ((NET_IPV6_HDR(_p)->vtc & 0xf0) == 0x60) - #define SHORT_ADDRESS_SIZE 2 #define FCS_SIZE 2 @@ -514,49 +508,19 @@ static void openthread_handle_received_frame(otInstance *instance, net_pkt_unref(pkt); } -#if defined(CONFIG_OPENTHREAD_NAT64_TRANSLATOR) - -static otMessage *openthread_ip4_new_msg(otInstance *instance, otMessageSettings *settings) -{ - return otIp4NewMessage(instance, settings); -} - -static otError openthread_nat64_send(otInstance *instance, otMessage *message) -{ - return otNat64Send(instance, message); -} - -#else /* CONFIG_OPENTHREAD_NAT64_TRANSLATOR */ - -static otMessage *openthread_ip4_new_msg(otInstance *instance, otMessageSettings *settings) -{ - return NULL; -} - -static otError openthread_nat64_send(otInstance *instance, otMessage *message) +static void openthread_handle_frame_to_send(otInstance *instance, + struct net_pkt *pkt) { - return OT_ERROR_DROP; -} - -#endif /* CONFIG_OPENTHREAD_NAT64_TRANSLATOR */ - -static void openthread_handle_frame_to_send(otInstance *instance, struct net_pkt *pkt) -{ - otError error; struct net_buf *buf; otMessage *message; otMessageSettings settings; - bool is_ip6 = PKT_IS_IPv6(pkt); - NET_DBG("Sending %s packet to ot stack", is_ip6 ? "IPv6" : "IPv4"); + NET_DBG("Sending Ip6 packet to ot stack"); settings.mPriority = OT_MESSAGE_PRIORITY_NORMAL; settings.mLinkSecurityEnabled = true; - - message = is_ip6 ? otIp6NewMessage(instance, &settings) - : openthread_ip4_new_msg(instance, &settings); - if (!message) { - NET_ERR("Cannot allocate new message buffer"); + message = otIp6NewMessage(instance, &settings); + if (message == NULL) { goto exit; } @@ -568,11 +532,9 @@ static void openthread_handle_frame_to_send(otInstance *instance, struct net_pkt } } - error = is_ip6 ? otIp6Send(instance, message) : openthread_nat64_send(instance, message); - - if (error != OT_ERROR_NONE) { - NET_ERR("Error while calling %s [error: %d]", - is_ip6 ? "otIp6Send" : "openthread_nat64_send", error); + if (otIp6Send(instance, message) != OT_ERROR_NONE) { + NET_ERR("Error while calling otIp6Send"); + goto exit; } exit: diff --git a/subsys/net/l2/openthread/openthread.c b/subsys/net/l2/openthread/openthread.c index c54f2bf5019..d820e083d8b 100644 --- a/subsys/net/l2/openthread/openthread.c +++ b/subsys/net/l2/openthread/openthread.c @@ -39,12 +39,6 @@ LOG_MODULE_REGISTER(net_l2_openthread, CONFIG_OPENTHREAD_L2_LOG_LEVEL); #include "openthread_utils.h" -#if defined(CONFIG_OPENTHREAD_NAT64_TRANSLATOR) -#include -#endif /* CONFIG_OPENTHREAD_NAT64_TRANSLATOR */ - -#define PKT_IS_IPv4(_p) ((NET_IPV6_HDR(_p)->vtc & 0xf0) == 0x40) - #define OT_STACK_SIZE (CONFIG_OPENTHREAD_THREAD_STACK_SIZE) #if defined(CONFIG_OPENTHREAD_THREAD_PREEMPTIVE) @@ -226,15 +220,6 @@ static void ot_state_changed_handler(uint32_t flags, void *context) add_ipv6_maddr_to_zephyr(ot_context); } -#if defined(CONFIG_OPENTHREAD_NAT64_TRANSLATOR) - - if (flags & OT_CHANGED_NAT64_TRANSLATOR_STATE) { - NET_DBG("Nat64 translator state changed to %x", - otNat64GetTranslatorState(ot_context->instance)); - } - -#endif /* CONFIG_OPENTHREAD_NAT64_TRANSLATOR */ - if (state_changed_cb) { state_changed_cb(flags, context); } @@ -284,15 +269,10 @@ static void ot_receive_handler(otMessage *aMessage, void *context) } } - NET_DBG("Injecting %s packet to Zephyr net stack", - PKT_IS_IPv4(pkt) ? "translated IPv4" : "Ip6"); + NET_DBG("Injecting Ip6 packet to Zephyr net stack"); if (IS_ENABLED(CONFIG_OPENTHREAD_L2_DEBUG_DUMP_IPV6)) { - if (IS_ENABLED(CONFIG_OPENTHREAD_NAT64_TRANSLATOR) && PKT_IS_IPv4(pkt)) { - net_pkt_hexdump(pkt, "Received NAT64 IPv4 packet"); - } else { - net_pkt_hexdump(pkt, "Received IPv6 packet"); - } + net_pkt_hexdump(pkt, "Received IPv6 packet"); } if (!pkt_list_is_full(ot_context)) { @@ -553,14 +533,6 @@ static int openthread_init(struct net_if *iface) otIp6SetReceiveFilterEnabled(ot_context->instance, true); otIp6SetReceiveCallback(ot_context->instance, ot_receive_handler, ot_context); - -#if defined(CONFIG_OPENTHREAD_NAT64_TRANSLATOR) - - otNat64SetReceiveIp4Callback(ot_context->instance, - ot_receive_handler, ot_context); - -#endif /* CONFIG_OPENTHREAD_NAT64_TRANSLATOR */ - sys_slist_init(&ot_context->state_change_cbs); err = otSetStateChangedCallback(ot_context->instance, &ot_state_changed_handler, From 11765ec1256bb410f44dc45634f0ca08c0816811 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 294/825] Revert "[nrf fromlist] scripts: west_commands: nrfjprog: Change tool-opt help text" This reverts commit 322426e214c7ba6e233bf03ac619a4040297dc4c. --- scripts/west_commands/runners/nrfjprog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/west_commands/runners/nrfjprog.py b/scripts/west_commands/runners/nrfjprog.py index ce135222ad0..e014eb5d594 100644 --- a/scripts/west_commands/runners/nrfjprog.py +++ b/scripts/west_commands/runners/nrfjprog.py @@ -33,7 +33,7 @@ def name(cls): @classmethod def tool_opt_help(cls) -> str: - return 'Additional options for nrfjprog, e.g. "--clockspeed"' + return 'Additional options for nrfjprog, e.g. "--recover"' @classmethod def do_create(cls, cfg, args): From 3d85f7e114e4baad17cd51cd31d319a2dd9cd33a Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:05 +0200 Subject: [PATCH 295/825] Revert "[nrf fromlist] scripts: west_commands: nrfjprog: Add support for --qspiini" This reverts commit 585c0a65f1810f36aeab09f5c026d37485223ce8. --- scripts/west_commands/runners/nrfjprog.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/scripts/west_commands/runners/nrfjprog.py b/scripts/west_commands/runners/nrfjprog.py index e014eb5d594..f4bdfa74f97 100644 --- a/scripts/west_commands/runners/nrfjprog.py +++ b/scripts/west_commands/runners/nrfjprog.py @@ -18,15 +18,6 @@ class NrfJprogBinaryRunner(NrfBinaryRunner): '''Runner front-end for nrfjprog.''' - def __init__(self, cfg, family, softreset, dev_id, erase=False, - reset=True, tool_opt=[], force=False, recover=False, - qspi_ini=None): - - super().__init__(cfg, family, softreset, dev_id, erase, reset, - tool_opt, force, recover) - - self.qspi_ini = qspi_ini - @classmethod def name(cls): return 'nrfjprog' @@ -41,12 +32,7 @@ def do_create(cls, cfg, args): args.dev_id, erase=args.erase, reset=args.reset, tool_opt=args.tool_opt, force=args.force, - recover=args.recover, qspi_ini=args.qspi_ini) - @classmethod - def do_add_parser(cls, parser): - super().do_add_parser(parser) - parser.add_argument('--qspiini', required=False, dest='qspi_ini', - help='path to an .ini file with qspi configuration') + recover=args.recover) def do_get_boards(self): snrs = self.check_output(['nrfjprog', '--ids']) @@ -95,9 +81,6 @@ def do_exec_op(self, op, force=False): if _op.get('verify'): # In the future there might be multiple verify modes cmd.append('--verify') - if self.qspi_ini: - cmd.append('--qspiini') - cmd.append(self.qspi_ini) elif op_type == 'recover': cmd.append('--recover') elif op_type == 'reset': From 1c6f42c476013872f118ee1d3009e02b0edb8af0 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 296/825] Revert "[nrf fromlist] tests: drivers: adc: add adc_error_cases tests." This reverts commit bd373f15cc4f05044fa645cbc7941bdf4285f43c. --- .../adc/adc_error_cases/CMakeLists.txt | 9 - .../boards/nrf52840dk_nrf52840.overlay | 11 - .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 11 - .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 11 - tests/drivers/adc/adc_error_cases/prj.conf | 3 - tests/drivers/adc/adc_error_cases/src/main.c | 244 ------------------ .../drivers/adc/adc_error_cases/testcase.yaml | 11 - 7 files changed, 300 deletions(-) delete mode 100644 tests/drivers/adc/adc_error_cases/CMakeLists.txt delete mode 100644 tests/drivers/adc/adc_error_cases/boards/nrf52840dk_nrf52840.overlay delete mode 100644 tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuapp.overlay delete mode 100644 tests/drivers/adc/adc_error_cases/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 tests/drivers/adc/adc_error_cases/prj.conf delete mode 100644 tests/drivers/adc/adc_error_cases/src/main.c delete mode 100644 tests/drivers/adc/adc_error_cases/testcase.yaml diff --git a/tests/drivers/adc/adc_error_cases/CMakeLists.txt b/tests/drivers/adc/adc_error_cases/CMakeLists.txt deleted file mode 100644 index 7b240573c84..00000000000 --- a/tests/drivers/adc/adc_error_cases/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(adc_error_cases) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/tests/drivers/adc/adc_error_cases/boards/nrf52840dk_nrf52840.overlay b/tests/drivers/adc/adc_error_cases/boards/nrf52840dk_nrf52840.overlay deleted file mode 100644 index 18e74f72ee2..00000000000 --- a/tests/drivers/adc/adc_error_cases/boards/nrf52840dk_nrf52840.overlay +++ /dev/null @@ -1,11 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2024 Nordic Semiconductor ASA - */ - -/ { - aliases { - adc = &adc; - }; -}; diff --git a/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 18e74f72ee2..00000000000 --- a/tests/drivers/adc/adc_error_cases/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,11 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2024 Nordic Semiconductor ASA - */ - -/ { - aliases { - adc = &adc; - }; -}; diff --git a/tests/drivers/adc/adc_error_cases/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/tests/drivers/adc/adc_error_cases/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 18e74f72ee2..00000000000 --- a/tests/drivers/adc/adc_error_cases/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,11 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2024 Nordic Semiconductor ASA - */ - -/ { - aliases { - adc = &adc; - }; -}; diff --git a/tests/drivers/adc/adc_error_cases/prj.conf b/tests/drivers/adc/adc_error_cases/prj.conf deleted file mode 100644 index 40f19db980d..00000000000 --- a/tests/drivers/adc/adc_error_cases/prj.conf +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_ZTEST=y - -CONFIG_ADC=y diff --git a/tests/drivers/adc/adc_error_cases/src/main.c b/tests/drivers/adc/adc_error_cases/src/main.c deleted file mode 100644 index 9e01979e801..00000000000 --- a/tests/drivers/adc/adc_error_cases/src/main.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright (c) 2024, Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include - -static const struct device *dev_adc = DEVICE_DT_GET(DT_ALIAS(adc)); -#define BUFFER_LEN 8 -uint16_t m_sample_buffer[BUFFER_LEN]; - -static struct adc_channel_cfg valid_channel_cfg = { - .gain = ADC_GAIN_1, - .channel_id = 0, - .reference = ADC_REF_INTERNAL, - .acquisition_time = ADC_ACQ_TIME_DEFAULT, - .differential = false, - #ifdef CONFIG_ADC_CONFIGURABLE_INPUTS - .input_positive = 1, - #endif -}; - -static struct adc_sequence valid_seq = { - .buffer = m_sample_buffer, - .buffer_size = BUFFER_LEN * sizeof(uint16_t), - .options = NULL, - .resolution = 8, - .oversampling = 0, - .channels = 1, -}; - -/** - * @brief test adc_read() with invalid oversampling value - * - * function should return -EINVAL - */ - -ZTEST(adc_error_cases, test_adc_read_invalid_oversampling) -{ - int ret; - - adc_channel_setup(dev_adc, &valid_channel_cfg); - - struct adc_sequence invalid_seq = valid_seq; - /* Set oversampling to invalid value */ - invalid_seq.oversampling = 99; - - ret = adc_read(dev_adc, &invalid_seq); - - zassert_true( - ret == -EINVAL, - "adc_read() should return -EINVAL," - " got unexpected value of %d", - ret - ); -} - -/** - * @brief test adc_read() with invalid resolution value - * - * function should return -EINVAL - */ - -ZTEST(adc_error_cases, test_adc_read_invalid_resolution) -{ - int ret; - - adc_channel_setup(dev_adc, &valid_channel_cfg); - - struct adc_sequence invalid_seq = valid_seq; - /* Set resolution to invalid value */ - invalid_seq.resolution = 99; - - ret = adc_read(dev_adc, &invalid_seq); - - zassert_true( - ret == -EINVAL, - "adc_read() should return -EINVAL," - " got unexpected value of %d", - ret - ); -} - -/** - * @brief test adc_read() with invalid channels value - * - * function should return -EINVAL - */ - -ZTEST(adc_error_cases, test_adc_read_invalid_channels) -{ - int ret; - - adc_channel_setup(dev_adc, &valid_channel_cfg); - - struct adc_sequence invalid_seq = valid_seq; - /* Set channels configuration to invalid value */ - invalid_seq.channels = 0; - - ret = adc_read(dev_adc, &invalid_seq); - - zassert_true( - ret == -EINVAL, - "adc_read() should return -EINVAL," - " got unexpected value of %d", - ret - ); -} - -/** - * @brief test adc_read() with not configured channel - * - * function should return -EINVAL - */ - -ZTEST(adc_error_cases, test_adc_read_not_configured_channel) -{ - int ret; - - adc_channel_setup(dev_adc, &valid_channel_cfg); - - struct adc_sequence invalid_seq = valid_seq; - /* Set channels configuration to use not configured channel */ - invalid_seq.channels = 2; - - ret = adc_read(dev_adc, &invalid_seq); - - zassert_true( - ret == -EINVAL, - "adc_read() should return -EINVAL," - " got unexpected value of %d", - ret - ); -} - -/** - * @brief test adc_read() with invalid buffer length - * - * function should return -ENOMEM - */ - -ZTEST(adc_error_cases, test_adc_read_invalid_buffer) -{ - int ret; - - adc_channel_setup(dev_adc, &valid_channel_cfg); - - struct adc_sequence invalid_seq = valid_seq; - /* set buffer size to 0 bytes */ - invalid_seq.buffer_size = 0; - - ret = adc_read(dev_adc, &invalid_seq); - - zassert_true( - ret == -ENOMEM, - "adc_read() should return -ENOMEM," - " got unexpected value of %d", - ret - ); -} - -/** - * @brief test adc_channel_setup() with invalid reference value - * - * function should return -EINVAL - */ - -ZTEST(adc_error_cases, test_adc_setup_invalid_reference) -{ - int ret; - - struct adc_channel_cfg invalid_channel_cfg = valid_channel_cfg; - /* set invalid reference */ - invalid_channel_cfg.reference = 99; - - ret = adc_channel_setup(dev_adc, &invalid_channel_cfg); - - zassert_true( - ret == -EINVAL, - "adc_channel_setup() should return -EINVAL," - " got unexpected value of %d", - ret - ); -} - -/** - * @brief test adc_read() with invalid gain value - * - * function should return -EINVAL - */ - -ZTEST(adc_error_cases, test_adc_setup_invalid_gain) -{ - int ret; - - struct adc_channel_cfg invalid_channel_cfg = valid_channel_cfg; - /* set invalid gain value */ - invalid_channel_cfg.gain = 99; - ret = adc_channel_setup(dev_adc, &invalid_channel_cfg); - zassert_true( - ret == -EINVAL, - "adc_channel_setup() should return -EINVAL," - " got unexpected value of %d", - ret - ); -} - -/** - * @brief test adc_read() with invalid acquisition time - * - * function should return -EINVAL - */ - -ZTEST(adc_error_cases, test_adc_setup_invalid_acquisition_time) -{ - int ret; - - struct adc_channel_cfg invalid_channel_cfg = valid_channel_cfg; - /* set invalid acquisition_time value */ - invalid_channel_cfg.acquisition_time = 16384; - - ret = adc_channel_setup(dev_adc, &invalid_channel_cfg); - - zassert_true( - ret == -EINVAL, - "adc_channel_setup() should return -EINVAL," - " got unexpected value of %d", - ret - ); -} - -static void *suite_setup(void) -{ - TC_PRINT("Test executed on %s\n", CONFIG_BOARD_TARGET); - TC_PRINT("===================================================================\n"); - - return NULL; -} - -ZTEST_SUITE(adc_error_cases, NULL, suite_setup, NULL, NULL, NULL); diff --git a/tests/drivers/adc/adc_error_cases/testcase.yaml b/tests/drivers/adc/adc_error_cases/testcase.yaml deleted file mode 100644 index 5b12e5f8ae0..00000000000 --- a/tests/drivers/adc/adc_error_cases/testcase.yaml +++ /dev/null @@ -1,11 +0,0 @@ -common: - tags: - - adc - - drivers -tests: - drivers.adc_error_cases: - depends_on: adc - platform_allow: - - nrf52840dk/nrf52840 - - nrf54l15pdk/nrf54l15/cpuapp - - nrf54h20dk/nrf54h20/cpuapp From 915953fbfd8d4b37cf3b9c5a3c1cdcdfd761ac06 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 297/825] Revert "[nrf fromlist] tests: drivers: adc_api: change second channel gain for nrf54." This reverts commit d27c6c4d45c1d5653847443cc8cbb94e5ce79710. --- .../adc/adc_api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 2 +- .../adc/adc_api/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/drivers/adc/adc_api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/adc/adc_api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index c80a7459f13..789d1efdf05 100644 --- a/tests/drivers/adc/adc_api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/drivers/adc/adc_api/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -25,7 +25,7 @@ channel@2 { reg = <2>; - zephyr,gain = "ADC_GAIN_2_3"; + zephyr,gain = "ADC_GAIN_1_2"; zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = ; zephyr,input-positive = ; diff --git a/tests/drivers/adc/adc_api/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/tests/drivers/adc/adc_api/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay index cfd54f1ba7f..e10ddc54328 100644 --- a/tests/drivers/adc/adc_api/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/adc/adc_api/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -25,7 +25,7 @@ channel@2 { reg = <2>; - zephyr,gain = "ADC_GAIN_2_3"; + zephyr,gain = "ADC_GAIN_1"; zephyr,reference = "ADC_REF_INTERNAL"; zephyr,acquisition-time = ; zephyr,input-positive = ; From 3dfe83c7629807ce575f1e37f59466a14d01fc20 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 298/825] Revert "[nrf fromlist] tests: drivers: adc_accuracy" This reverts commit 750d7e9ff051d3dab03b46756963090a63a7543b. --- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 26 ------------------- .../adc/adc_accuracy_test/testcase.yaml | 1 - 2 files changed, 27 deletions(-) delete mode 100644 tests/drivers/adc/adc_accuracy_test/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay diff --git a/tests/drivers/adc/adc_accuracy_test/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/tests/drivers/adc/adc_accuracy_test/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 950c52047f6..00000000000 --- a/tests/drivers/adc/adc_accuracy_test/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,26 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2024 Nordic Semiconductor ASA - */ - -/ { - zephyr,user { - io-channels = <&adc 0>; - reference_mv = <1800>; - }; -}; - -&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 = <14>; - }; -}; diff --git a/tests/drivers/adc/adc_accuracy_test/testcase.yaml b/tests/drivers/adc/adc_accuracy_test/testcase.yaml index c0aa8926c01..ca184d485aa 100644 --- a/tests/drivers/adc/adc_accuracy_test/testcase.yaml +++ b/tests/drivers/adc/adc_accuracy_test/testcase.yaml @@ -18,5 +18,4 @@ tests: platform_allow: - frdm_kl25z - nrf52840dk/nrf52840 - - nrf54l15pdk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpuapp From 21c0f2b3038551fb5896f09562a8c0aa9eb03ee1 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 299/825] Revert "[nrf fromlist] tests: drivers: adc_accuracy" This reverts commit dfcb52090b25bd0e4fc0480a3f8cb729a9b8d634. --- .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 26 ------------------- .../adc/adc_accuracy_test/testcase.yaml | 1 - 2 files changed, 27 deletions(-) delete mode 100644 tests/drivers/adc/adc_accuracy_test/boards/nrf54h20dk_nrf54h20_cpuapp.overlay diff --git a/tests/drivers/adc/adc_accuracy_test/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/drivers/adc/adc_accuracy_test/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 20bd3110aff..00000000000 --- a/tests/drivers/adc/adc_accuracy_test/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,26 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2024 Nordic Semiconductor ASA - */ - -/ { - zephyr,user { - io-channels = <&adc 0>; - reference_mv = <1800>; - }; -}; - -&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 = <14>; - }; -}; diff --git a/tests/drivers/adc/adc_accuracy_test/testcase.yaml b/tests/drivers/adc/adc_accuracy_test/testcase.yaml index ca184d485aa..156bbfb7362 100644 --- a/tests/drivers/adc/adc_accuracy_test/testcase.yaml +++ b/tests/drivers/adc/adc_accuracy_test/testcase.yaml @@ -18,4 +18,3 @@ tests: platform_allow: - frdm_kl25z - nrf52840dk/nrf52840 - - nrf54h20dk/nrf54h20/cpuapp From ba11959b2a1ce3d457fd1aa31880dbcf474a70ed Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 300/825] Revert "[nrf fromlist] tests: drivers: adc_accuracy" This reverts commit 860f386a8213beb7848baa42cb2f6d293e799786. --- .../boards/nrf52840dk_nrf52840.overlay | 28 ------------------- .../adc/adc_accuracy_test/testcase.yaml | 1 - 2 files changed, 29 deletions(-) delete mode 100644 tests/drivers/adc/adc_accuracy_test/boards/nrf52840dk_nrf52840.overlay diff --git a/tests/drivers/adc/adc_accuracy_test/boards/nrf52840dk_nrf52840.overlay b/tests/drivers/adc/adc_accuracy_test/boards/nrf52840dk_nrf52840.overlay deleted file mode 100644 index 85a8c6880c9..00000000000 --- a/tests/drivers/adc/adc_accuracy_test/boards/nrf52840dk_nrf52840.overlay +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * Copyright (c) 2024 Nordic Semiconductor ASA - */ - - -/ { - zephyr,user { - io-channels = <&adc 0>; - reference_mv = <3000>; - }; -}; - -&adc { - #address-cells = <1>; - #size-cells = <0>; - - channel@0 { - reg = <0>; - zephyr,gain = "ADC_GAIN_1_6"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; /* P0.03 */ - zephyr,resolution = <14>; - }; - -}; diff --git a/tests/drivers/adc/adc_accuracy_test/testcase.yaml b/tests/drivers/adc/adc_accuracy_test/testcase.yaml index 156bbfb7362..07bf2e50119 100644 --- a/tests/drivers/adc/adc_accuracy_test/testcase.yaml +++ b/tests/drivers/adc/adc_accuracy_test/testcase.yaml @@ -17,4 +17,3 @@ tests: fixture: adc_ref_volt platform_allow: - frdm_kl25z - - nrf52840dk/nrf52840 From 7ac0fecf9a770b5c2976ad461b692808d66c225e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 301/825] Revert "[nrf fromlist] tests: drivers: spi: nordic: add device PM runtime" This reverts commit a19a7285a58f631c3507c2886e3d9cb1a758c07f. --- .../boards/nrf52840dk_nrf52840.overlay | 1 - .../boards/nrf54l15pdk_nrf54l15_cpuapp.overlay | 1 - tests/drivers/spi/spi_controller_peripheral/testcase.yaml | 6 ------ tests/drivers/spi/spi_loopback/testcase.yaml | 5 ----- 4 files changed, 13 deletions(-) diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf52840dk_nrf52840.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf52840dk_nrf52840.overlay index f0909162552..97802a7a637 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf52840dk_nrf52840.overlay +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf52840dk_nrf52840.overlay @@ -53,7 +53,6 @@ dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; - spi-max-frequency = ; }; }; diff --git a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay index 6ba01f86352..73a50a7c6fc 100644 --- a/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ b/tests/drivers/spi/spi_controller_peripheral/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -57,7 +57,6 @@ dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; reg = <0>; - spi-max-frequency = ; }; }; diff --git a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml index ecf491fed79..18dfb9db1cd 100644 --- a/tests/drivers/spi/spi_controller_peripheral/testcase.yaml +++ b/tests/drivers/spi/spi_controller_peripheral/testcase.yaml @@ -57,9 +57,3 @@ tests: - nrf52840dk/nrf52840 - nrf54l15pdk/nrf54l15/cpuapp - nrf54h20dk/nrf54h20/cpurad - - drivers.spi.pm_runtime: - extra_configs: - - CONFIG_PM_DEVICE=y - - CONFIG_PM_DEVICE_RUNTIME=y - filter: CONFIG_SOC_FAMILY_NORDIC_NRF diff --git a/tests/drivers/spi/spi_loopback/testcase.yaml b/tests/drivers/spi/spi_loopback/testcase.yaml index fed71fbcce6..4a858b481c8 100644 --- a/tests/drivers/spi/spi_loopback/testcase.yaml +++ b/tests/drivers/spi/spi_loopback/testcase.yaml @@ -173,8 +173,3 @@ tests: extra_args: DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" platform_allow: - nrf54h20dk/nrf54h20/cpuapp - drivers.spi.nrf_pm_runtime: - extra_configs: - - CONFIG_PM_DEVICE=y - - CONFIG_PM_DEVICE_RUNTIME=y - filter: CONFIG_SOC_FAMILY_NORDIC_NRF From 7436c54536616a62bf20799e31d381cfc2467daf Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 302/825] Revert "[nrf fromlist] drivers: spi: nrfx_spim: Add support for device PM" This reverts commit fbeccb47b68c291cbfa5e7a42e08e7ccff725a36. --- drivers/spi/spi_nrfx_spim.c | 101 +++++++++++++----------------------- 1 file changed, 37 insertions(+), 64 deletions(-) diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index c21fd01f6ff..e1ce774af52 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -140,56 +139,15 @@ static inline nrf_spim_bit_order_t get_nrf_spim_bit_order(uint16_t operation) } } -static int spim_init(const struct device *dev) -{ - struct spi_nrfx_data *dev_data = dev->data; - const struct spi_nrfx_config *dev_config = dev->config; - nrfx_spim_config_t config; - struct spi_context *ctx = &dev_data->ctx; - const struct spi_config *spi_cfg = ctx->config; - uint32_t max_freq = dev_config->max_freq; - nrfx_err_t result = NRFX_SUCCESS; - -#if defined(CONFIG_SOC_NRF5340_CPUAPP) - /* On nRF5340, the 32 Mbps speed is supported by the application core - * when it is running at 128 MHz (see the Timing specifications section - * in the nRF5340 PS). - */ - if (max_freq > 16000000 && - nrf_clock_hfclk_div_get(NRF_CLOCK) != NRF_CLOCK_HFCLK_DIV_1) { - max_freq = 16000000; - } -#endif - - config = dev_config->def_config; - - /* Limit the frequency to that supported by the SPIM instance. */ - config.frequency = get_nrf_spim_frequency(MIN(spi_cfg->frequency, - max_freq)); - config.mode = get_nrf_spim_mode(spi_cfg->operation); - config.bit_order = get_nrf_spim_bit_order(spi_cfg->operation); - - if (dev_data->initialized) { - nrfx_spim_uninit(&dev_config->spim); - dev_data->initialized = false; - } - - result = nrfx_spim_init(&dev_config->spim, &config, - event_handler, (void *)dev); - if (result != NRFX_SUCCESS) { - LOG_ERR("Failed to initialize nrfx driver: %08x", result); - return -EIO; - } - return 0; -} - static int configure(const struct device *dev, const struct spi_config *spi_cfg) { struct spi_nrfx_data *dev_data = dev->data; const struct spi_nrfx_config *dev_config = dev->config; struct spi_context *ctx = &dev_data->ctx; - int ret; + uint32_t max_freq = dev_config->max_freq; + nrfx_spim_config_t config; + nrfx_err_t result; if (dev_data->initialized && spi_context_configured(ctx, spi_cfg)) { /* Already configured. No need to do it again. */ @@ -227,22 +185,44 @@ static int configure(const struct device *dev, return -EINVAL; } +#if defined(CONFIG_SOC_NRF5340_CPUAPP) + /* On nRF5340, the 32 Mbps speed is supported by the application core + * when it is running at 128 MHz (see the Timing specifications section + * in the nRF5340 PS). + */ + if (max_freq > 16000000 && + nrf_clock_hfclk_div_get(NRF_CLOCK) != NRF_CLOCK_HFCLK_DIV_1) { + max_freq = 16000000; + } +#endif + + config = dev_config->def_config; + + /* Limit the frequency to that supported by the SPIM instance. */ + config.frequency = get_nrf_spim_frequency(MIN(spi_cfg->frequency, + max_freq)); + config.mode = get_nrf_spim_mode(spi_cfg->operation); + config.bit_order = get_nrf_spim_bit_order(spi_cfg->operation); + nrfy_gpio_pin_write(nrfy_spim_sck_pin_get(dev_config->spim.p_reg), spi_cfg->operation & SPI_MODE_CPOL ? 1 : 0); - ctx->config = spi_cfg; -#ifdef CONFIG_PM_DEVICE_RUNTIME - ret = pm_device_runtime_get(dev); -#else - ret = spim_init(dev); -#endif - if (ret < 0) { + if (dev_data->initialized) { + nrfx_spim_uninit(&dev_config->spim); + dev_data->initialized = false; + } - return ret; + result = nrfx_spim_init(&dev_config->spim, &config, + event_handler, (void *)dev); + if (result != NRFX_SUCCESS) { + LOG_ERR("Failed to initialize nrfx driver: %08x", result); + return -EIO; } dev_data->initialized = true; + ctx->config = spi_cfg; + return 0; } @@ -340,7 +320,6 @@ static void finish_transaction(const struct device *dev, int error) dev_data->busy = false; finalize_spi_transaction(dev, true); - (void)pm_device_runtime_put(dev); } static void transfer_next_chunk(const struct device *dev) @@ -600,7 +579,9 @@ static int spim_nrfx_pm_action(const struct device *dev, if (ret < 0) { return ret; } - ret = spim_init(dev); + /* nrfx_spim_init() will be called at configuration before + * the next transfer. + */ break; case PM_DEVICE_ACTION_SUSPEND: @@ -631,10 +612,7 @@ static int spi_nrfx_init(const struct device *dev) struct spi_nrfx_data *dev_data = dev->data; int err; - err = pinctrl_apply_state(dev_config->pcfg, - COND_CODE_1(CONFIG_PM_DEVICE_RUNTIME, - (PINCTRL_STATE_SLEEP), - (PINCTRL_STATE_DEFAULT))); + err = pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_DEFAULT); if (err < 0) { return err; } @@ -660,11 +638,6 @@ static int spi_nrfx_init(const struct device *dev) spi_context_unlock_unconditionally(&dev_data->ctx); -#ifdef CONFIG_PM_DEVICE_RUNTIME - pm_device_init_suspended(dev); - pm_device_runtime_enable(dev); -#endif - #ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 return anomaly_58_workaround_init(dev); #else From fe7668558c7f0d2accff6b2317a63f05269613f7 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 303/825] Revert "[nrf fromlist] tests: kernel: timer: Exclude nRF54H20 PPR core" This reverts commit 652c15568ab0ec3b8199f7b27c33f6e3923afe17. --- tests/kernel/timer/timer_api/Kconfig | 3 --- tests/kernel/timer/timer_behavior/testcase.yaml | 2 -- 2 files changed, 5 deletions(-) diff --git a/tests/kernel/timer/timer_api/Kconfig b/tests/kernel/timer/timer_api/Kconfig index 7854b2cacd7..9a0bfb8c74d 100644 --- a/tests/kernel/timer/timer_api/Kconfig +++ b/tests/kernel/timer/timer_api/Kconfig @@ -4,7 +4,4 @@ config SYS_CLOCK_TICKS_PER_SEC default 16384 if NRF_RTC_TIMER && TICKLESS_KERNEL -config ASSERT_VERBOSE - default n if SOC_NRF54H20_CPUPPR - source "Kconfig.zephyr" diff --git a/tests/kernel/timer/timer_behavior/testcase.yaml b/tests/kernel/timer/timer_behavior/testcase.yaml index b71fd006dbb..11ac75e5597 100644 --- a/tests/kernel/timer/timer_behavior/testcase.yaml +++ b/tests/kernel/timer/timer_behavior/testcase.yaml @@ -8,8 +8,6 @@ tests: - mcu simulation_exclude: - renode - platform_exclude: - - nrf54h20dk/nrf54h20/cpuppr kernel.timer.timer_behavior_external: filter: dt_compat_enabled("test-kernel-timer-behavior-external") harness: pytest From 9cadd2f2f8e61190e0e2578484aa2ea25e171f28 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 304/825] Revert "[nrf fromlist] tests: kernel: timer: Fix failing tests" This reverts commit 3a13f259f3314fe614dc22cbc9d88f4bc2cb48fa. --- tests/kernel/timer/timer_api/src/main.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/tests/kernel/timer/timer_api/src/main.c b/tests/kernel/timer/timer_api/src/main.c index 33c3c632a6a..ba9a76d4085 100644 --- a/tests/kernel/timer/timer_api/src/main.c +++ b/tests/kernel/timer/timer_api/src/main.c @@ -28,22 +28,15 @@ struct timer_data { */ #define INEXACT_MS_CONVERT ((CONFIG_SYS_CLOCK_TICKS_PER_SEC % MSEC_PER_SEC) != 0) -#if CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT && CONFIG_NRF_RTC_TIMER -/* On Nordic SOCs using RTC_TIMER as the system timer and custom k_busy_wait() implementation, - * one or both of the tick and busy-wait clocks may derive from sources that have slews that - * sum to +/- 13%. +#if CONFIG_NRF_RTC_TIMER +/* On Nordic SOCs one or both of the tick and busy-wait clocks may + * derive from sources that have slews that sum to +/- 13%. */ #define BUSY_TICK_SLEW_PPM 130000U -#elif CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT && CONFIG_NRF_GRTC_TIMER -/* On Nordic SOCs using GRTC_TIMER as the system timer and custom k_busy_wait() implementation, - * one or both of the tick and busy-wait clocks may derive from sources that have slews that - * sum to +/- 2%. - */ -#define BUSY_TICK_SLEW_PPM 20000U #else -/* In other cases assume the clocks are perfectly aligned. */ +/* On other platforms assume the clocks are perfectly aligned. */ #define BUSY_TICK_SLEW_PPM 0U -#endif /* CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT && CONFIG_NRF_RTC_TIMER */ +#endif #define PPM_DIVISOR 1000000U /* If the tick clock is faster or slower than the busywait clock the From a223d1f7d390e25ebfdd40a1df08e04d9eef30c8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 305/825] Revert "[nrf fromlist] test: drivers: pwm: add fast PWM" This reverts commit b8abfdb61b03f7681876d362752bbf42da608aaa. --- .../nrf54h20dk_nrf54h20_cpuapp_fast.overlay | 21 ------------------- tests/drivers/pwm/pwm_api/testcase.yaml | 5 ----- 2 files changed, 26 deletions(-) delete mode 100644 tests/drivers/pwm/pwm_api/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay diff --git a/tests/drivers/pwm/pwm_api/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay b/tests/drivers/pwm/pwm_api/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay deleted file mode 100644 index c4e2cb8c38b..00000000000 --- a/tests/drivers/pwm/pwm_api/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay +++ /dev/null @@ -1,21 +0,0 @@ -&pinctrl { - pwm_default: pwm_default { - group1 { - psels = ; - }; - }; - pwm_sleep: pwm_sleep { - group1 { - psels = ; - low-power-enable; - }; - }; -}; - -&pwm120 { - status = "okay"; - pinctrl-0 = <&pwm_default>; - pinctrl-1 = <&pwm_sleep>; - pinctrl-names = "default", "sleep"; - memory-regions = <&dma_fast_region>; -}; diff --git a/tests/drivers/pwm/pwm_api/testcase.yaml b/tests/drivers/pwm/pwm_api/testcase.yaml index 28d6bb8ab97..aca9172fc96 100644 --- a/tests/drivers/pwm/pwm_api/testcase.yaml +++ b/tests/drivers/pwm/pwm_api/testcase.yaml @@ -8,8 +8,3 @@ tests: or dt_alias_exists("pwm-3") or dt_compat_enabled("st,stm32-pwm") or dt_compat_enabled("intel,blinky-pwm") or dt_compat_enabled("nordic,nrf-pwm") depends_on: pwm - - drivers.pwm.pwm_fast: - extra_args: DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp From 9269e41d4fd4063c2e8a507cf2e1042044a5e026 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 306/825] Revert "[nrf noup] drivers: flash: kconfig: nrf_rram region resolution" This reverts commit 66628acfb7a88e71fe06124649168a02c94996d9. --- 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 0350771d2d0..244a5386ad1 100644 --- a/drivers/flash/Kconfig.nrf_rram +++ b/drivers/flash/Kconfig.nrf_rram @@ -69,14 +69,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 4f18e59b0996c3547a0e03bd5d0e96f5e959e6e7 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 307/825] Revert "[nrf noup] ci: add suit-dfu-test to test-spec" This reverts commit 037880d96cc1fcfd43831fa762efd4f2a70ca96b. --- .github/test-spec.yml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/.github/test-spec.yml b/.github/test-spec.yml index f0c0cd9b133..dabe1630349 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -363,28 +363,3 @@ - "samples/subsys/usb/mass/**/*" - "samples/subsys/usb/cdc_acm/**/*" - "modules/hal_nordic/**/*" - -"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/**/*" - - "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 df0ce68ca137b22688c293050452bcf27f5ce4fc Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 308/825] Revert "[nrf fromlist] scripts: Undo Board.{dir -> directories[0]} renames" This reverts commit af38d0bbaca4cfc78b1fa515b57abc11891304d1. --- doc/_extensions/zephyr/kconfig/__init__.py | 3 ++- scripts/ci/check_compliance.py | 8 +++++--- scripts/ci/test_plan.py | 2 +- scripts/list_boards.py | 2 +- scripts/west_commands/boards.py | 3 ++- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index 4a58b370cce..26c082a086a 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -127,7 +127,8 @@ def kconfig_load(app: Sphinx) -> Tuple[kconfiglib.Kconfig, Dict[str, str]]: board_str = 'BOARD_' + re.sub(r"[^a-zA-Z0-9_]", "_", qualifier).upper() f.write('config ' + board_str + '\n') f.write('\t bool\n') - f.write('source "' + (board.dir / ('Kconfig.' + board.name)).as_posix() + '"\n\n') + f.write('source "' + + (board.directories[0] / ('Kconfig.' + board.name)).as_posix() + '"\n\n') # base environment os.environ["ZEPHYR_BASE"] = str(ZEPHYR_BASE) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 50241b39842..3d42b642f0e 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -479,7 +479,8 @@ def get_v2_model(self, kconfig_dir, settings_file): with open(kconfig_defconfig_file, 'w') as fp: for board in v2_boards: - fp.write('osource "' + (Path(board.dir) / 'Kconfig.defconfig').as_posix() + '"\n') + fp.write('osource "' + + (board.directories[0] / 'Kconfig.defconfig').as_posix() + '"\n') with open(kconfig_boards_file, 'w') as fp: for board in v2_boards: @@ -492,7 +493,8 @@ def get_v2_model(self, kconfig_dir, settings_file): fp.write('config ' + board_str + '\n') fp.write('\t bool\n') fp.write( - 'source "' + (Path(board.dir) / ('Kconfig.' + board.name)).as_posix() + '"\n\n' + 'source "' + + (board.directories[0] / ('Kconfig.' + board.name)).as_posix() + '"\n\n' ) with open(kconfig_file, 'w') as fp: @@ -500,7 +502,7 @@ def get_v2_model(self, kconfig_dir, settings_file): 'osource "' + (Path(kconfig_dir) / 'boards' / 'Kconfig.syms.v1').as_posix() + '"\n' ) for board in v2_boards: - fp.write('osource "' + (Path(board.dir) / 'Kconfig').as_posix() + '"\n') + fp.write('osource "' + (Path(board.directories[0]) / 'Kconfig').as_posix() + '"\n') kconfig_defconfig_file = os.path.join(kconfig_dir, 'soc', 'Kconfig.defconfig') kconfig_soc_file = os.path.join(kconfig_dir, 'soc', 'Kconfig.soc') diff --git a/scripts/ci/test_plan.py b/scripts/ci/test_plan.py index 3a36a11dd4e..7501db5198a 100755 --- a/scripts/ci/test_plan.py +++ b/scripts/ci/test_plan.py @@ -242,7 +242,7 @@ def find_boards(self): for changed in changed_boards: for board in known_boards: c = (zephyr_base / changed).resolve() - if c.is_relative_to(board.dir.resolve()): + if c.is_relative_to(board.directories[0].resolve()): for file in glob.glob(os.path.join(board.dir, f"{board.name}*.yaml")): with open(file, 'r') as f: b = yaml.load(f.read(), Loader=SafeLoader) diff --git a/scripts/list_boards.py b/scripts/list_boards.py index 12222c13846..c2b8e3740b3 100755 --- a/scripts/list_boards.py +++ b/scripts/list_boards.py @@ -445,7 +445,7 @@ def dump_boards(args): if args.cmakeformat is not None: info = args.cmakeformat.format( NAME='NAME;' + board.name, - DIR='DIR;' + str(board.dir.as_posix()), + DIR='DIR;' + str(board.directories.as_posix()), HWM='HWM;' + board.hwm, VENDOR='VENDOR;NOTFOUND', REVISION_DEFAULT='REVISION_DEFAULT;NOTFOUND', diff --git a/scripts/west_commands/boards.py b/scripts/west_commands/boards.py index 3e171bbabe4..ae57545da7c 100644 --- a/scripts/west_commands/boards.py +++ b/scripts/west_commands/boards.py @@ -98,5 +98,6 @@ def do_run(self, args, _): for board in list_boards.find_v2_boards(args).values(): if name_re is not None and not name_re.search(board.name): continue - log.inf(args.format.format(name=board.name, arch='', dir=board.dir, hwm=board.hwm, + log.inf(args.format.format(name=board.name, arch='', dir=board.directories[0], + hwm=board.hwm, qualifiers=list_boards.board_v2_qualifiers_csv(board))) From 8bc4851d0d9173885d24576d842c2e4c918e94d6 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 309/825] Revert "[nrf fromlist] scripts: list_boards: Reintroduce Board.dir as @property" This reverts commit a51f1aae72b0188b436fc5e7b3c72038f2e7ae6d. --- scripts/list_boards.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scripts/list_boards.py b/scripts/list_boards.py index c2b8e3740b3..23859e00cce 100755 --- a/scripts/list_boards.py +++ b/scripts/list_boards.py @@ -103,13 +103,6 @@ class Board: socs: List[Soc] = field(default_factory=list, compare=False) variants: List[str] = field(default_factory=list, compare=False) - @property - def dir(self): - # Get the main board directory. - if isinstance(self.directories, Path): - return self.directories - return self.directories[0] - def from_qualifier(self, qualifiers): qualifiers_list = qualifiers.split('/') From 4a757f4fcbd91a258ee5357d84c073690e0d0bba Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 310/825] Revert "[nrf fromlist] scripts: ci: test_plan: use find_modules only when commits are provided" This reverts commit ba97e9de030fcb4b27682495c47199e002ae5170. --- scripts/ci/test_plan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci/test_plan.py b/scripts/ci/test_plan.py index 7501db5198a..ea833daa796 100755 --- a/scripts/ci/test_plan.py +++ b/scripts/ci/test_plan.py @@ -149,7 +149,7 @@ def get_plan(self, options, integration=False, use_testsuite_root=True): os.remove(fname) def find_modules(self): - if 'west.yml' in self.modified_files and args.commits is not None: + if 'west.yml' in self.modified_files: print(f"Manifest file 'west.yml' changed") print("=========") old_manifest_content = repo_to_scan.git.show(f"{args.commits[:-2]}:west.yml") From ca3d71195a7d0feac229fec3bb4f7fa106b37266 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 311/825] Revert "[nrf fromlist] net: wifi: Add reset command for Wi-Fi statistics" This reverts commit 2af340094e8a9d644291e32f40aaf2918e5158ad. --- subsys/net/l2/wifi/wifi_shell.c | 34 +++++---------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index c68c1c07cb5..399ef457fc5 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -886,30 +886,10 @@ static int cmd_wifi_stats(const struct shell *sh, size_t argc, char *argv[]) struct net_stats_wifi stats = { 0 }; int ret; - context.sh = sh; - - if (argc == 1) { - ret = net_mgmt(NET_REQUEST_STATS_GET_WIFI, iface, - &stats, sizeof(stats)); - if (!ret) { - print_wifi_stats(iface, &stats, sh); - } - } - - if (argc > 1) { - if (!strncasecmp(argv[1], "reset", 5)) { - ret = net_mgmt(NET_REQUEST_STATS_RESET_WIFI, iface, - &stats, sizeof(stats)); - if (!ret) { - PR("Wi-Fi interface statistics have been reset.\n"); - } - } else if (!strncasecmp(argv[1], "help", 4)) { - shell_help(sh); - } else { - PR_WARNING("Invalid argument\n"); - shell_help(sh); - return -ENOEXEC; - } + ret = net_mgmt(NET_REQUEST_STATS_GET_WIFI, iface, + &stats, sizeof(stats)); + if (!ret) { + print_wifi_stats(iface, &stats, sh); } #else ARG_UNUSED(argc); @@ -2061,11 +2041,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(wifi_commands, "[-h, --help] : Print out the help for the scan command.\n", cmd_wifi_scan, 1, 8), - SHELL_CMD_ARG(statistics, NULL, "Wi-Fi interface statistics.\n" - "[reset] : Reset Wi-Fi interface statistics\n" - "[help] : Print out the help for the statistics command.", - cmd_wifi_stats, - 1, 1), + SHELL_CMD_ARG(statistics, NULL, "Wi-Fi interface statistics.\n", cmd_wifi_stats, 1, 0), SHELL_CMD_ARG(status, NULL, "Status of the Wi-Fi interface.\n", cmd_wifi_status, 1, 0), SHELL_CMD(twt, &wifi_twt_ops, "Manage TWT flows.\n", NULL), SHELL_CMD_ARG(reg_domain, NULL, From 193d90117cfabe86726cf0bfa309861e61684817 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 312/825] Revert "[nrf fromlist] wifi_mgmt: Add new API to reset Wi-Fi statistics" This reverts commit 40ff9367d562176c2799b7b530c9b7d9a4974ef3. --- include/zephyr/net/net_stats.h | 9 --------- include/zephyr/net/wifi_mgmt.h | 7 ------- subsys/net/l2/wifi/wifi_mgmt.c | 14 -------------- 3 files changed, 30 deletions(-) diff --git a/include/zephyr/net/net_stats.h b/include/zephyr/net/net_stats.h index 17ca3638889..5a2ac84eaa2 100644 --- a/include/zephyr/net/net_stats.h +++ b/include/zephyr/net/net_stats.h @@ -648,7 +648,6 @@ enum net_request_stats_cmd { NET_REQUEST_STATS_CMD_GET_PPP, NET_REQUEST_STATS_CMD_GET_PM, NET_REQUEST_STATS_CMD_GET_WIFI, - NET_REQUEST_STATS_CMD_RESET_WIFI, }; /** @endcond */ @@ -778,14 +777,6 @@ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_STATS_GET_PM); /** @cond INTERNAL_HIDDEN */ NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_STATS_GET_WIFI); /** @endcond */ - -/** Reset Wi-Fi statistics*/ -#define NET_REQUEST_STATS_RESET_WIFI \ - (_NET_STATS_BASE | NET_REQUEST_STATS_CMD_RESET_WIFI) - -/** @cond INTERNAL_HIDDEN */ -NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_STATS_RESET_WIFI); -/** @endcond */ #endif /* CONFIG_NET_STATISTICS_WIFI */ /** diff --git a/include/zephyr/net/wifi_mgmt.h b/include/zephyr/net/wifi_mgmt.h index deab64cc756..616541776e0 100644 --- a/include/zephyr/net/wifi_mgmt.h +++ b/include/zephyr/net/wifi_mgmt.h @@ -863,13 +863,6 @@ struct wifi_mgmt_ops { * @return 0 if ok, < 0 if error */ int (*get_stats)(const struct device *dev, struct net_stats_wifi *stats); - /** Reset Wi-Fi statistics - * - * @param dev Pointer to the device structure for the driver instance. - * - * @return 0 if ok, < 0 if error - */ - int (*reset_stats)(const struct device *dev); #endif /* CONFIG_NET_STATISTICS_WIFI */ /** Set power save status * diff --git a/subsys/net/l2/wifi/wifi_mgmt.c b/subsys/net/l2/wifi/wifi_mgmt.c index a3072db97f1..c329db7f8f3 100644 --- a/subsys/net/l2/wifi/wifi_mgmt.c +++ b/subsys/net/l2/wifi/wifi_mgmt.c @@ -515,20 +515,6 @@ static int wifi_iface_stats(uint32_t mgmt_request, struct net_if *iface, return wifi_mgmt_api->get_stats(dev, stats); } NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_STATS_GET_WIFI, wifi_iface_stats); - -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); - const struct wifi_mgmt_ops *const wifi_mgmt_api = get_wifi_api(iface); - - if (wifi_mgmt_api == NULL || wifi_mgmt_api->reset_stats == NULL) { - return -ENOTSUP; - } - - return wifi_mgmt_api->reset_stats(dev); -} -NET_MGMT_REGISTER_REQUEST_HANDLER(NET_REQUEST_STATS_RESET_WIFI, wifi_iface_stats_reset); #endif /* CONFIG_NET_STATISTICS_WIFI */ static int wifi_set_power_save(uint32_t mgmt_request, struct net_if *iface, From f2fd1f064471af17e7e165f459bfa06299bdb647 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:06 +0200 Subject: [PATCH 313/825] Revert "[nrf fromlist] drivers: mbox: Fix error code in Nordic's implementation" This reverts commit bdab5cd9276e0d824b335a56912111b894f75117. --- drivers/mbox/mbox_nrf_bellboard_tx.c | 2 +- drivers/mbox/mbox_nrf_vevif_event_tx.c | 2 +- drivers/mbox/mbox_nrf_vevif_task_tx.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mbox/mbox_nrf_bellboard_tx.c b/drivers/mbox/mbox_nrf_bellboard_tx.c index 9f98f57ff5d..e3f297623a6 100644 --- a/drivers/mbox/mbox_nrf_bellboard_tx.c +++ b/drivers/mbox/mbox_nrf_bellboard_tx.c @@ -23,7 +23,7 @@ static int bellboard_tx_send(const struct device *dev, uint32_t id, const struct } if (msg != NULL) { - return -EMSGSIZE; + return -ENOTSUP; } nrfy_bellboard_task_trigger(config->bellboard, nrf_bellboard_trigger_task_get(id)); diff --git a/drivers/mbox/mbox_nrf_vevif_event_tx.c b/drivers/mbox/mbox_nrf_vevif_event_tx.c index 6a9e51aab50..e323a07bb7d 100644 --- a/drivers/mbox/mbox_nrf_vevif_event_tx.c +++ b/drivers/mbox/mbox_nrf_vevif_event_tx.c @@ -38,7 +38,7 @@ static int vevif_event_tx_send(const struct device *dev, uint32_t id, const stru } if (msg != NULL) { - return -EMSGSIZE; + return -ENOTSUP; } nrf_vpr_csr_vevif_events_trigger(BIT(id)); diff --git a/drivers/mbox/mbox_nrf_vevif_task_tx.c b/drivers/mbox/mbox_nrf_vevif_task_tx.c index 191a94962d6..6aac7522617 100644 --- a/drivers/mbox/mbox_nrf_vevif_task_tx.c +++ b/drivers/mbox/mbox_nrf_vevif_task_tx.c @@ -38,7 +38,7 @@ static int vevif_task_tx_send(const struct device *dev, uint32_t id, const struc } if (msg != NULL) { - return -EMSGSIZE; + return -ENOTSUP; } nrfy_vpr_task_trigger(config->vpr, nrfy_vpr_trigger_task_get(id)); From f39df2e5fb086aa364a838022f21e096bdac3a41 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:07 +0200 Subject: [PATCH 314/825] Revert "[nrf fromlist] samples: drivers: mbox: Disable UART Flow Control on nrf54h20 and nrf54l15" This reverts commit 611d3986e009b1039e42074937e5c5996147e2c4. --- .../mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay | 4 ---- .../remote/boards/nrf54l15pdk_nrf54l15_cpuflpr_xip.overlay | 4 ---- 2 files changed, 8 deletions(-) diff --git a/samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay b/samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay index 20ce53cf824..cf232439953 100644 --- a/samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay +++ b/samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay @@ -18,7 +18,3 @@ &cpuflpr_vevif_tx { status = "okay"; }; - -&uart30 { - /delete-property/ hw-flow-control; -}; diff --git a/samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr_xip.overlay b/samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr_xip.overlay index 20ce53cf824..cf232439953 100644 --- a/samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr_xip.overlay +++ b/samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr_xip.overlay @@ -18,7 +18,3 @@ &cpuflpr_vevif_tx { status = "okay"; }; - -&uart30 { - /delete-property/ hw-flow-control; -}; From 58845d201f2bd5bd995828b95c1fdec3e3c0478d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:07 +0200 Subject: [PATCH 315/825] Revert "[nrf fromtree] samples: ipc: icmsg: Align icmsg sample for nRF54L15" This reverts commit 245675dfcfae9713001de65b2d1073827062ce40. --- .../ipc/ipc_service/icmsg/CMakeLists.txt | 3 +- .../ipc/ipc_service/icmsg/Kconfig.sysbuild | 1 - .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 41 ------------------- .../nrf54l15pdk_nrf54l15_cpuflpr.overlay | 41 ------------------- .../subsys/ipc/ipc_service/icmsg/sample.yaml | 9 ---- .../subsys/ipc/ipc_service/icmsg/src/main.c | 6 +-- 6 files changed, 2 insertions(+), 99 deletions(-) delete mode 100644 samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay diff --git a/samples/subsys/ipc/ipc_service/icmsg/CMakeLists.txt b/samples/subsys/ipc/ipc_service/icmsg/CMakeLists.txt index 24bc2fb8821..ca0ce8a8cff 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/CMakeLists.txt +++ b/samples/subsys/ipc/ipc_service/icmsg/CMakeLists.txt @@ -8,8 +8,7 @@ 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_NRF54L15PDK_NRF54L15_CPUAPP) +if(NOT CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP) message(FATAL_ERROR "${BOARD} is not supported for this sample") endif() diff --git a/samples/subsys/ipc/ipc_service/icmsg/Kconfig.sysbuild b/samples/subsys/ipc/ipc_service/icmsg/Kconfig.sysbuild index 90c81a9ba8e..d0849e37dde 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/Kconfig.sysbuild +++ b/samples/subsys/ipc/ipc_service/icmsg/Kconfig.sysbuild @@ -7,4 +7,3 @@ source "share/sysbuild/Kconfig" config NET_CORE_BOARD string default "nrf5340dk/nrf5340/cpunet" if $(BOARD) = "nrf5340dk" - default "nrf54l15pdk/nrf54l15/cpuflpr" if $(BOARD) = "nrf54l15pdk" diff --git a/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 0cfaf565349..00000000000 --- a/samples/subsys/ipc/ipc_service/icmsg/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - soc { - reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - - sram_rx: memory@20018000 { - reg = <0x20018000 0x0800>; - }; - - sram_tx: memory@20020000 { - reg = <0x20020000 0x0800>; - }; - }; - }; - - ipc { - ipc0: ipc0 { - compatible = "zephyr,ipc-icmsg"; - tx-region = <&sram_tx>; - rx-region = <&sram_rx>; - mboxes = <&cpuapp_vevif_rx 15>, <&cpuapp_vevif_tx 16>; - mbox-names = "rx", "tx"; - status = "okay"; - }; - }; -}; - -&cpuapp_vevif_rx { - status = "okay"; -}; - -&cpuapp_vevif_tx { - status = "okay"; -}; diff --git a/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay b/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay deleted file mode 100644 index 2219b7b78fa..00000000000 --- a/samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - soc { - reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - - sram_tx: memory@20018000 { - reg = <0x20018000 0x0800>; - }; - - sram_rx: memory@20020000 { - reg = <0x20020000 0x0800>; - }; - }; - }; - - ipc { - ipc0: ipc0 { - compatible = "zephyr,ipc-icmsg"; - tx-region = <&sram_tx>; - rx-region = <&sram_rx>; - mboxes = <&cpuflpr_vevif_rx 16>, <&cpuflpr_vevif_tx 15>; - mbox-names = "rx", "tx"; - status = "okay"; - }; - }; -}; - -&cpuflpr_vevif_rx { - status = "okay"; -}; - -&cpuflpr_vevif_tx { - status = "okay"; -}; diff --git a/samples/subsys/ipc/ipc_service/icmsg/sample.yaml b/samples/subsys/ipc/ipc_service/icmsg/sample.yaml index 298c41f56db..ee24fc1aec1 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/sample.yaml +++ b/samples/subsys/ipc/ipc_service/icmsg/sample.yaml @@ -18,12 +18,3 @@ tests: - "host: Sent" - "host: Received" - "host: IPC-service HOST demo ended" - sample.ipc.icmsg.nrf54l15: - platform_allow: nrf54l15pdk/nrf54l15/cpuapp - integration_platforms: - - nrf54l15pdk/nrf54l15/cpuapp - tags: ipc - extra_args: - icmsg_SNIPPET=nordic-flpr - sysbuild: true - harness: remote diff --git a/samples/subsys/ipc/ipc_service/icmsg/src/main.c b/samples/subsys/ipc/ipc_service/icmsg/src/main.c index f864d552e7f..d10fa6c8bf6 100644 --- a/samples/subsys/ipc/ipc_service/icmsg/src/main.c +++ b/samples/subsys/ipc/ipc_service/icmsg/src/main.c @@ -8,9 +8,7 @@ #include #include -#if defined(CONFIG_SOC_NRF5340_CPUAPP) #include -#endif #include #include "common.h" @@ -128,10 +126,9 @@ int main(void) return ret; } - LOG_INF("Wait 500ms. Let remote core finish its sends"); + LOG_INF("Wait 500ms. Let net core finish its sends"); k_msleep(500); -#if defined(CONFIG_SOC_NRF5340_CPUAPP) LOG_INF("Stop network core"); nrf53_cpunet_enable(false); @@ -170,7 +167,6 @@ int main(void) LOG_ERR("send_for_time() failure"); return ret; } -#endif /* CONFIG_SOC_NRF5340_CPUAPP */ LOG_INF("IPC-service HOST demo ended"); From c80bdd45ee1fc7896a7b5f6dc4057cee18136a5e Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:07 +0200 Subject: [PATCH 316/825] Revert "[nrf fromtree] samples: mbox: Add nRF54L15 to MBOX sample targets" This reverts commit 06cf8bd76dffe23e89b453614e176ad5fdce1ac7. --- samples/drivers/mbox/CMakeLists.txt | 3 +-- samples/drivers/mbox/Kconfig.sysbuild | 1 - .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 20 ------------------- samples/drivers/mbox/remote/CMakeLists.txt | 4 +--- .../nrf54l15pdk_nrf54l15_cpuflpr.overlay | 20 ------------------- .../nrf54l15pdk_nrf54l15_cpuflpr_xip.overlay | 20 ------------------- samples/drivers/mbox/sample.yaml | 16 --------------- 7 files changed, 2 insertions(+), 82 deletions(-) delete mode 100644 samples/drivers/mbox/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay delete mode 100644 samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr_xip.overlay diff --git a/samples/drivers/mbox/CMakeLists.txt b/samples/drivers/mbox/CMakeLists.txt index 5e2a955036d..64b1a032547 100644 --- a/samples/drivers/mbox/CMakeLists.txt +++ b/samples/drivers/mbox/CMakeLists.txt @@ -18,8 +18,7 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP OR CONFIG_BOARD_MIMXRT1160_EVK_MIMXRT1166_CM7 OR CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0 OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR - CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD OR - CONFIG_BOARD_NRF54L15PDK_NRF54L15_CPUAPP) + CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD) message(STATUS "${BOARD}${BOARD_QUALIFIERS} compile as Main in this sample") else() message(FATAL_ERROR "${BOARD}${BOARD_QUALIFIERS} is not supported for this sample") diff --git a/samples/drivers/mbox/Kconfig.sysbuild b/samples/drivers/mbox/Kconfig.sysbuild index 77cda9c3365..5678dbbc260 100644 --- a/samples/drivers/mbox/Kconfig.sysbuild +++ b/samples/drivers/mbox/Kconfig.sysbuild @@ -16,4 +16,3 @@ string default "lpcxpresso55s69/lpc55s69/cpu1" if $(BOARD) = "lpcxpresso55s69" default "nrf54h20dk/nrf54h20/cpuppr" if "$(BOARD)${BOARD_QUALIFIERS}" = "nrf54h20dk/nrf54h20/cpuapp" default "nrf54h20dk/nrf54h20/cpuapp" if "$(BOARD)${BOARD_QUALIFIERS}" = "nrf54h20dk/nrf54h20/cpurad" - default "nrf54l15pdk/nrf54l15/cpuflpr" if $(BOARD) = "nrf54l15pdk" diff --git a/samples/drivers/mbox/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/drivers/mbox/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index 3ec014008e5..00000000000 --- a/samples/drivers/mbox/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - mbox-consumer { - compatible = "vnd,mbox-consumer"; - mboxes = <&cpuapp_vevif_rx 15>, <&cpuapp_vevif_tx 16>; - 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 1a5d8fced94..ca9fd71bda1 100644 --- a/samples/drivers/mbox/remote/CMakeLists.txt +++ b/samples/drivers/mbox/remote/CMakeLists.txt @@ -16,9 +16,7 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUNET OR CONFIG_BOARD_MIMXRT1160_EVK_MIMXRT1166_CM4 OR CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU1 OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUPPR OR - CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR - CONFIG_BOARD_NRF54L15PDK_NRF54L15_CPUFLPR OR - CONFIG_BOARD_NRF54L15PDK_NRF54L15_CPUFLPR_XIP) + CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP) message(STATUS "${BOARD}${BOARD_QUALIFIERS} compile as remote in this sample") else() message(FATAL_ERROR "${BOARD}${BOARD_QUALIFIERS} is not supported for this sample") diff --git a/samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay b/samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay deleted file mode 100644 index cf232439953..00000000000 --- a/samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr.overlay +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - mbox-consumer { - compatible = "vnd,mbox-consumer"; - mboxes = <&cpuflpr_vevif_rx 16>, <&cpuflpr_vevif_tx 15>; - mbox-names = "rx", "tx"; - }; -}; - -&cpuflpr_vevif_rx { - status = "okay"; -}; - -&cpuflpr_vevif_tx { - status = "okay"; -}; diff --git a/samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr_xip.overlay b/samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr_xip.overlay deleted file mode 100644 index cf232439953..00000000000 --- a/samples/drivers/mbox/remote/boards/nrf54l15pdk_nrf54l15_cpuflpr_xip.overlay +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -/ { - mbox-consumer { - compatible = "vnd,mbox-consumer"; - mboxes = <&cpuflpr_vevif_rx 16>, <&cpuflpr_vevif_tx 15>; - mbox-names = "rx", "tx"; - }; -}; - -&cpuflpr_vevif_rx { - status = "okay"; -}; - -&cpuflpr_vevif_tx { - status = "okay"; -}; diff --git a/samples/drivers/mbox/sample.yaml b/samples/drivers/mbox/sample.yaml index 01646f040bc..75de1dcd701 100644 --- a/samples/drivers/mbox/sample.yaml +++ b/samples/drivers/mbox/sample.yaml @@ -66,19 +66,3 @@ tests: - "Pong \\(on channel 0\\)" - "Ping \\(on channel 1\\)" - "Pong \\(on channel 1\\)" - - sample.drivers.mbox.nrf54l15: - platform_allow: - - nrf54l15pdk/nrf54l15/cpuapp - integration_platforms: - - nrf54l15pdk/nrf54l15/cpuapp - extra_args: - mbox_SNIPPET=nordic-flpr - sysbuild: true - harness: console - harness_config: - type: multi_line - ordered: false - regex: - - "Ping \\(on channel 16\\)" - - "Pong \\(on channel 15\\)" From a3292d97c82672a8a59a9f0f1518d6eab34127fd Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:07 +0200 Subject: [PATCH 317/825] Revert "[nrf fromtree] dts: nordic: Align boards dts to new VEVIF, BELLBOARD nomenclature" This reverts commit 5c24516ab2df3815ff86e70abe4b526de3a007be. --- dts/arm/nordic/nrf54h20_cpuapp.dtsi | 10 +++++----- dts/arm/nordic/nrf54h20_cpurad.dtsi | 10 +++++----- dts/common/nordic/nrf54h20.dtsi | 12 ++++++------ dts/riscv/nordic/nrf54h20_cpuppr.dtsi | 10 +++++----- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/dts/arm/nordic/nrf54h20_cpuapp.dtsi b/dts/arm/nordic/nrf54h20_cpuapp.dtsi index 895ca8ea20b..1cfa3dddb55 100644 --- a/dts/arm/nordic/nrf54h20_cpuapp.dtsi +++ b/dts/arm/nordic/nrf54h20_cpuapp.dtsi @@ -9,8 +9,8 @@ cpu: &cpuapp {}; systick: &cpuapp_systick {}; nvic: &cpuapp_nvic {}; -cpuppr_vevif: &cpuppr_vevif_tx {}; -cpusys_vevif: &cpusys_vevif_tx {}; +cpuppr_vevif: &cpuppr_vevif_remote {}; +cpusys_vevif: &cpusys_vevif_remote {}; wdt010: &cpuapp_wdt010 {}; wdt011: &cpuapp_wdt011 {}; @@ -34,15 +34,15 @@ wdt011: &cpuapp_wdt011 {}; }; &cpusec_bellboard { - compatible = "nordic,nrf-bellboard-tx"; + compatible = "nordic,nrf-bellboard-remote"; }; &cpuapp_bellboard { - compatible = "nordic,nrf-bellboard-rx"; + compatible = "nordic,nrf-bellboard-local"; }; &cpurad_bellboard { - compatible = "nordic,nrf-bellboard-tx"; + compatible = "nordic,nrf-bellboard-remote"; }; &gpiote130 { diff --git a/dts/arm/nordic/nrf54h20_cpurad.dtsi b/dts/arm/nordic/nrf54h20_cpurad.dtsi index 20da9dbe3cd..b426d660f3d 100644 --- a/dts/arm/nordic/nrf54h20_cpurad.dtsi +++ b/dts/arm/nordic/nrf54h20_cpurad.dtsi @@ -9,8 +9,8 @@ cpu: &cpurad {}; systick: &cpurad_systick {}; nvic: &cpurad_nvic {}; -cpuppr_vevif: &cpuppr_vevif_tx {}; -cpusys_vevif: &cpusys_vevif_tx {}; +cpuppr_vevif: &cpuppr_vevif_remote {}; +cpusys_vevif: &cpusys_vevif_remote {}; wdt010: &cpurad_wdt010 {}; wdt011: &cpurad_wdt011 {}; @@ -34,15 +34,15 @@ wdt011: &cpurad_wdt011 {}; }; &cpusec_bellboard { - compatible = "nordic,nrf-bellboard-tx"; + compatible = "nordic,nrf-bellboard-remote"; }; &cpuapp_bellboard { - compatible = "nordic,nrf-bellboard-tx"; + compatible = "nordic,nrf-bellboard-remote"; }; &cpurad_bellboard { - compatible = "nordic,nrf-bellboard-rx"; + compatible = "nordic,nrf-bellboard-local"; }; &gpiote130 { diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index 2ee655b76ab..86be478cb9b 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -43,8 +43,8 @@ riscv,isa = "rv32emc"; nordic,bus-width = <32>; - cpuppr_vevif_rx: mailbox { - compatible = "nordic,nrf-vevif-task-rx"; + cpuppr_vevif_local: mailbox { + compatible = "nordic,nrf-vevif-local"; status = "disabled"; interrupt-parent = <&cpuppr_clic>; interrupts = <0 NRF_DEFAULT_IRQ_PRIORITY>, @@ -412,8 +412,8 @@ status = "disabled"; }; - cpusys_vevif_tx: mailbox@8c8000 { - compatible = "nordic,nrf-vevif-task-tx"; + cpusys_vevif_remote: mailbox@8c8000 { + compatible = "nordic,nrf-vevif-remote"; reg = <0x8c8000 0x1000>; status = "disabled"; #mbox-cells = <1>; @@ -517,8 +517,8 @@ #size-cells = <1>; ranges = <0x0 0x908000 0x4000>; - cpuppr_vevif_tx: mailbox@0 { - compatible = "nordic,nrf-vevif-task-tx"; + cpuppr_vevif_remote: mailbox@0 { + compatible = "nordic,nrf-vevif-remote"; reg = <0x0 0x1000>; status = "disabled"; #mbox-cells = <1>; diff --git a/dts/riscv/nordic/nrf54h20_cpuppr.dtsi b/dts/riscv/nordic/nrf54h20_cpuppr.dtsi index 057b45f3560..1f2900769dd 100644 --- a/dts/riscv/nordic/nrf54h20_cpuppr.dtsi +++ b/dts/riscv/nordic/nrf54h20_cpuppr.dtsi @@ -8,8 +8,8 @@ cpu: &cpuppr {}; clic: &cpuppr_clic {}; -cpuppr_vevif: &cpuppr_vevif_rx {}; -cpusys_vevif: &cpusys_vevif_tx {}; +cpuppr_vevif: &cpuppr_vevif_local {}; +cpusys_vevif: &cpusys_vevif_remote {}; /delete-node/ &cpuapp; /delete-node/ &cpuapp_peripherals; @@ -33,15 +33,15 @@ cpusys_vevif: &cpusys_vevif_tx {}; }; &cpusec_bellboard { - compatible = "nordic,nrf-bellboard-tx"; + compatible = "nordic,nrf-bellboard-remote"; }; &cpuapp_bellboard { - compatible = "nordic,nrf-bellboard-tx"; + compatible = "nordic,nrf-bellboard-remote"; }; &cpurad_bellboard { - compatible = "nordic,nrf-bellboard-tx"; + compatible = "nordic,nrf-bellboard-remote"; }; &gpiote130 { From fb2abe9f09c07fbfe70f6e0900c381291aa2cbcf Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:07 +0200 Subject: [PATCH 318/825] Revert "[nrf fromtree] drivers: mbox: nrf: Change VEVIFs and BELLBOARD nomenclature" This reverts commit a050bcba21bf7085f4bc19bc2b87723e6b21bac0. --- drivers/mbox/CMakeLists.txt | 8 +- drivers/mbox/Kconfig | 2 +- drivers/mbox/Kconfig.nrf_bellboard | 16 +-- drivers/mbox/Kconfig.nrf_vevif | 16 +++ drivers/mbox/Kconfig.nrf_vevif_task | 16 --- ...lboard_rx.c => mbox_nrf_bellboard_local.c} | 28 ++-- ...board_tx.c => mbox_nrf_bellboard_remote.c} | 24 ++-- drivers/mbox/mbox_nrf_vevif_local.c | 122 ++++++++++++++++ ...evif_task_tx.c => mbox_nrf_vevif_remote.c} | 44 +++--- drivers/mbox/mbox_nrf_vevif_task_rx.c | 133 ------------------ ...x.yaml => nordic,nrf-bellboard-local.yaml} | 6 +- ....yaml => nordic,nrf-bellboard-remote.yaml} | 6 +- .../mbox/nordic,nrf-vevif-common.yaml | 18 +++ dts/bindings/mbox/nordic,nrf-vevif-local.yaml | 32 +++++ .../mbox/nordic,nrf-vevif-remote.yaml | 29 ++++ .../mbox/nordic,nrf-vevif-task-rx.yaml | 49 ------- .../mbox/nordic,nrf-vevif-task-tx.yaml | 46 ------ 17 files changed, 281 insertions(+), 314 deletions(-) create mode 100644 drivers/mbox/Kconfig.nrf_vevif delete mode 100644 drivers/mbox/Kconfig.nrf_vevif_task rename drivers/mbox/{mbox_nrf_bellboard_rx.c => mbox_nrf_bellboard_local.c} (82%) rename drivers/mbox/{mbox_nrf_bellboard_tx.c => mbox_nrf_bellboard_remote.c} (60%) create mode 100644 drivers/mbox/mbox_nrf_vevif_local.c rename drivers/mbox/{mbox_nrf_vevif_task_tx.c => mbox_nrf_vevif_remote.c} (52%) delete mode 100644 drivers/mbox/mbox_nrf_vevif_task_rx.c rename dts/bindings/mbox/{nordic,nrf-bellboard-rx.yaml => nordic,nrf-bellboard-local.yaml} (88%) rename dts/bindings/mbox/{nordic,nrf-bellboard-tx.yaml => nordic,nrf-bellboard-remote.yaml} (76%) create mode 100644 dts/bindings/mbox/nordic,nrf-vevif-common.yaml create mode 100644 dts/bindings/mbox/nordic,nrf-vevif-local.yaml create mode 100644 dts/bindings/mbox/nordic,nrf-vevif-remote.yaml delete mode 100644 dts/bindings/mbox/nordic,nrf-vevif-task-rx.yaml delete mode 100644 dts/bindings/mbox/nordic,nrf-vevif-task-tx.yaml diff --git a/drivers/mbox/CMakeLists.txt b/drivers/mbox/CMakeLists.txt index 3bfca6e5adf..1c71d696d14 100644 --- a/drivers/mbox/CMakeLists.txt +++ b/drivers/mbox/CMakeLists.txt @@ -10,9 +10,9 @@ zephyr_library_sources_ifdef(CONFIG_MBOX_NXP_S32_MRU mbox_nxp_s32_mru.c) zephyr_library_sources_ifdef(CONFIG_MBOX_NXP_IMX_MU mbox_nxp_imx_mu.c) zephyr_library_sources_ifdef(CONFIG_MBOX_NXP_MAILBOX mbox_nxp_mailbox.c) zephyr_library_sources_ifdef(CONFIG_MBOX_ANDES_PLIC_SW mbox_andes_plic_sw.c) -zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_VEVIF_TASK_RX mbox_nrf_vevif_task_rx.c) -zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_VEVIF_TASK_TX mbox_nrf_vevif_task_tx.c) +zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_VEVIF_LOCAL mbox_nrf_vevif_local.c) +zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_VEVIF_REMOTE mbox_nrf_vevif_remote.c) zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_VEVIF_EVENT_RX mbox_nrf_vevif_event_rx.c) zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_VEVIF_EVENT_TX mbox_nrf_vevif_event_tx.c) -zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_BELLBOARD_RX mbox_nrf_bellboard_rx.c) -zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_BELLBOARD_TX mbox_nrf_bellboard_tx.c) +zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_BELLBOARD_LOCAL mbox_nrf_bellboard_local.c) +zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_BELLBOARD_REMOTE mbox_nrf_bellboard_remote.c) diff --git a/drivers/mbox/Kconfig b/drivers/mbox/Kconfig index 0917d07d459..4f0a8e627fe 100644 --- a/drivers/mbox/Kconfig +++ b/drivers/mbox/Kconfig @@ -17,7 +17,7 @@ source "drivers/mbox/Kconfig.nxp_s32" source "drivers/mbox/Kconfig.nxp_imx" source "drivers/mbox/Kconfig.nxp_mailbox" source "drivers/mbox/Kconfig.andes" -source "drivers/mbox/Kconfig.nrf_vevif_task" +source "drivers/mbox/Kconfig.nrf_vevif" source "drivers/mbox/Kconfig.nrf_vevif_event" source "drivers/mbox/Kconfig.nrf_bellboard" diff --git a/drivers/mbox/Kconfig.nrf_bellboard b/drivers/mbox/Kconfig.nrf_bellboard index 7f9f8568ad5..45233122bd5 100644 --- a/drivers/mbox/Kconfig.nrf_bellboard +++ b/drivers/mbox/Kconfig.nrf_bellboard @@ -1,16 +1,16 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config MBOX_NRF_BELLBOARD_RX - bool "nRF BELLBOARD RX driver" - depends on DT_HAS_NORDIC_NRF_BELLBOARD_RX_ENABLED +config MBOX_NRF_BELLBOARD_LOCAL + bool "nRF BELLBOARD local driver" + depends on DT_HAS_NORDIC_NRF_BELLBOARD_LOCAL_ENABLED default y help - Mailbox driver for RX Nordic nRF BELLBOARD + Mailbox driver for local Nordic nRF BELLBOARD -config MBOX_NRF_BELLBOARD_TX - bool "nRF BELLBOARD TX driver" - depends on DT_HAS_NORDIC_NRF_BELLBOARD_TX_ENABLED +config MBOX_NRF_BELLBOARD_REMOTE + bool "nRF BELLBOARD remote driver" + depends on DT_HAS_NORDIC_NRF_BELLBOARD_REMOTE_ENABLED default y help - Mailbox driver for TX Nordic nRF BELLBOARD + Mailbox driver for remote Nordic nRF BELLBOARD diff --git a/drivers/mbox/Kconfig.nrf_vevif b/drivers/mbox/Kconfig.nrf_vevif new file mode 100644 index 00000000000..4abb0ef8241 --- /dev/null +++ b/drivers/mbox/Kconfig.nrf_vevif @@ -0,0 +1,16 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config MBOX_NRF_VEVIF_LOCAL + bool "nRF VEVIF local driver" + depends on DT_HAS_NORDIC_NRF_VEVIF_LOCAL_ENABLED + default y + help + Mailbox driver for local Nordic nRF VEVIF (VPR Event Interface) + +config MBOX_NRF_VEVIF_REMOTE + bool "nRF VEVIF remote driver" + depends on DT_HAS_NORDIC_NRF_VEVIF_REMOTE_ENABLED + default y + help + Mailbox driver for remote Nordic nRF VEVIF (VPR Event Interface) diff --git a/drivers/mbox/Kconfig.nrf_vevif_task b/drivers/mbox/Kconfig.nrf_vevif_task deleted file mode 100644 index e421877c6d2..00000000000 --- a/drivers/mbox/Kconfig.nrf_vevif_task +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config MBOX_NRF_VEVIF_TASK_RX - bool "nRF VEVIF task RX driver" - depends on DT_HAS_NORDIC_NRF_VEVIF_TASK_RX_ENABLED - default y - help - Mailbox driver for receiving VEVIF tasks on VPR as CLIC interrupts - -config MBOX_NRF_VEVIF_TASK_TX - bool "nRF VEVIF task TX driver" - depends on DT_HAS_NORDIC_NRF_VEVIF_TASK_TX_ENABLED - default y - help - Mailbox driver for transmitting VEVIF tasks to VPR as CLIC interrupts diff --git a/drivers/mbox/mbox_nrf_bellboard_rx.c b/drivers/mbox/mbox_nrf_bellboard_local.c similarity index 82% rename from drivers/mbox/mbox_nrf_bellboard_rx.c rename to drivers/mbox/mbox_nrf_bellboard_local.c index 8b98d361d0c..99d05351aaa 100644 --- a/drivers/mbox/mbox_nrf_bellboard_rx.c +++ b/drivers/mbox/mbox_nrf_bellboard_local.c @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#define DT_DRV_COMPAT nordic_nrf_bellboard_rx +#define DT_DRV_COMPAT nordic_nrf_bellboard_local #include #include @@ -37,7 +37,7 @@ static mbox_callback_t cbs[NRF_BELLBOARD_EVENTS_TRIGGERED_COUNT]; static void *cbs_ctx[NRF_BELLBOARD_EVENTS_TRIGGERED_COUNT]; static uint32_t evt_enabled_masks[BELLBOARD_NUM_IRQS]; -static void bellboard_rx_isr(const void *parameter) +static void bellboard_local_isr(const void *parameter) { uint8_t irq_idx = (uint8_t)(uintptr_t)parameter; uint32_t int_pend; @@ -59,15 +59,15 @@ static void bellboard_rx_isr(const void *parameter) } } -static uint32_t bellboard_rx_max_channels_get(const struct device *dev) +static uint32_t bellboard_local_max_channels_get(const struct device *dev) { ARG_UNUSED(dev); return NRF_BELLBOARD_EVENTS_TRIGGERED_COUNT; } -static int bellboard_rx_register_callback(const struct device *dev, uint32_t id, mbox_callback_t cb, - void *user_data) +static int bellboard_local_register_callback(const struct device *dev, uint32_t id, + mbox_callback_t cb, void *user_data) { ARG_UNUSED(dev); @@ -81,7 +81,7 @@ static int bellboard_rx_register_callback(const struct device *dev, uint32_t id, return 0; } -static int bellboard_rx_set_enabled(const struct device *dev, uint32_t id, bool enable) +static int bellboard_local_set_enabled(const struct device *dev, uint32_t id, bool enable) { bool valid_found = false; @@ -125,21 +125,21 @@ static int bellboard_rx_set_enabled(const struct device *dev, uint32_t id, bool return 0; } -static const struct mbox_driver_api bellboard_rx_driver_api = { - .max_channels_get = bellboard_rx_max_channels_get, - .register_callback = bellboard_rx_register_callback, - .set_enabled = bellboard_rx_set_enabled, +static const struct mbox_driver_api bellboard_local_driver_api = { + .max_channels_get = bellboard_local_max_channels_get, + .register_callback = bellboard_local_register_callback, + .set_enabled = bellboard_local_set_enabled, }; #define BELLBOARD_IRQ_CONFIGURE(name, idx) \ COND_CODE_1(DT_INST_IRQ_HAS_NAME(0, name), \ (IRQ_CONNECT(DT_INST_IRQ_BY_NAME(0, name, irq), \ - DT_INST_IRQ_BY_NAME(0, name, priority), bellboard_rx_isr, \ + DT_INST_IRQ_BY_NAME(0, name, priority), bellboard_local_isr, \ (const void *)idx, 0); \ irq_enable(DT_INST_IRQ_BY_NAME(0, name, irq));), \ ()) -static int bellboard_rx_init(const struct device *dev) +static int bellboard_local_init(const struct device *dev) { uint32_t evt_all_mappings = evt_mappings[0] | evt_mappings[1] | evt_mappings[2] | evt_mappings[3]; @@ -165,5 +165,5 @@ static int bellboard_rx_init(const struct device *dev) return 0; } -DEVICE_DT_INST_DEFINE(0, bellboard_rx_init, NULL, NULL, NULL, POST_KERNEL, - CONFIG_MBOX_INIT_PRIORITY, &bellboard_rx_driver_api); +DEVICE_DT_INST_DEFINE(0, bellboard_local_init, NULL, NULL, NULL, POST_KERNEL, + CONFIG_MBOX_INIT_PRIORITY, &bellboard_local_driver_api); diff --git a/drivers/mbox/mbox_nrf_bellboard_tx.c b/drivers/mbox/mbox_nrf_bellboard_remote.c similarity index 60% rename from drivers/mbox/mbox_nrf_bellboard_tx.c rename to drivers/mbox/mbox_nrf_bellboard_remote.c index e3f297623a6..c362522c0bf 100644 --- a/drivers/mbox/mbox_nrf_bellboard_tx.c +++ b/drivers/mbox/mbox_nrf_bellboard_remote.c @@ -3,20 +3,20 @@ * SPDX-License-Identifier: Apache-2.0 */ -#define DT_DRV_COMPAT nordic_nrf_bellboard_tx +#define DT_DRV_COMPAT nordic_nrf_bellboard_remote #include #include #include -struct mbox_bellboard_tx_conf { +struct mbox_bellboard_remote_conf { NRF_BELLBOARD_Type *bellboard; }; -static int bellboard_tx_send(const struct device *dev, uint32_t id, const struct mbox_msg *msg) +static int bellboard_remote_send(const struct device *dev, uint32_t id, const struct mbox_msg *msg) { - const struct mbox_bellboard_tx_conf *config = dev->config; + const struct mbox_bellboard_remote_conf *config = dev->config; if (id >= BELLBOARD_TASKS_TRIGGER_MaxCount) { return -EINVAL; @@ -31,32 +31,32 @@ static int bellboard_tx_send(const struct device *dev, uint32_t id, const struct return 0; } -static int bellboard_tx_mtu_get(const struct device *dev) +static int bellboard_remote_mtu_get(const struct device *dev) { ARG_UNUSED(dev); return 0; } -static uint32_t bellboard_tx_max_channels_get(const struct device *dev) +static uint32_t bellboard_remote_max_channels_get(const struct device *dev) { ARG_UNUSED(dev); return BELLBOARD_TASKS_TRIGGER_MaxCount; } -static const struct mbox_driver_api bellboard_tx_driver_api = { - .send = bellboard_tx_send, - .mtu_get = bellboard_tx_mtu_get, - .max_channels_get = bellboard_tx_max_channels_get, +static const struct mbox_driver_api bellboard_remote_driver_api = { + .send = bellboard_remote_send, + .mtu_get = bellboard_remote_mtu_get, + .max_channels_get = bellboard_remote_max_channels_get, }; #define BELLBOARD_REMOTE_DEFINE(inst) \ - static const struct mbox_bellboard_tx_conf conf##inst = { \ + static const struct mbox_bellboard_remote_conf conf##inst = { \ .bellboard = (NRF_BELLBOARD_Type *)DT_INST_REG_ADDR(inst), \ }; \ \ DEVICE_DT_INST_DEFINE(inst, NULL, NULL, NULL, &conf##inst, POST_KERNEL, \ - CONFIG_MBOX_INIT_PRIORITY, &bellboard_tx_driver_api); + CONFIG_MBOX_INIT_PRIORITY, &bellboard_remote_driver_api); DT_INST_FOREACH_STATUS_OKAY(BELLBOARD_REMOTE_DEFINE) diff --git a/drivers/mbox/mbox_nrf_vevif_local.c b/drivers/mbox/mbox_nrf_vevif_local.c new file mode 100644 index 00000000000..56cb5cc49d9 --- /dev/null +++ b/drivers/mbox/mbox_nrf_vevif_local.c @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#define DT_DRV_COMPAT nordic_nrf_vevif_local + +#include +#include + +#include +#include +#include + +#define VEVIF_TASKS_NUM DT_INST_PROP(0, nordic_tasks) +#define VEVIF_TASKS_MASK DT_INST_PROP(0, nordic_tasks_mask) + +BUILD_ASSERT(VEVIF_TASKS_NUM <= VPR_TASKS_TRIGGER_MaxCount, "Number of tasks exceeds maximum"); +BUILD_ASSERT(VEVIF_TASKS_NUM == DT_NUM_IRQS(DT_DRV_INST(0)), "# IRQs != # tasks"); + +/* callbacks */ +struct mbox_vevif_local_cbs { + mbox_callback_t cb[VEVIF_TASKS_NUM]; + void *user_data[VEVIF_TASKS_NUM]; + uint32_t enabled_mask; +}; + +static struct mbox_vevif_local_cbs cbs; + +/* IRQ list */ +#define VEVIF_IRQN(idx, _) DT_INST_IRQ_BY_IDX(0, idx, irq) + +static const uint8_t vevif_irqs[VEVIF_TASKS_NUM] = { + LISTIFY(DT_NUM_IRQS(DT_DRV_INST(0)), VEVIF_IRQN, (,)) +}; + +static void vevif_local_isr(const void *parameter) +{ + uint8_t id = *(uint8_t *)parameter; + + nrf_vpr_csr_vevif_tasks_clear(BIT(id)); + + if (cbs.cb[id] != NULL) { + cbs.cb[id](DEVICE_DT_INST_GET(0), id, cbs.user_data[id], NULL); + } +} + +static inline bool vevif_local_is_task_valid(uint32_t id) +{ + return (id < VEVIF_TASKS_NUM) && ((VEVIF_TASKS_MASK & BIT(id)) != 0U); +} + +static uint32_t vevif_local_max_channels_get(const struct device *dev) +{ + ARG_UNUSED(dev); + + return VEVIF_TASKS_NUM; +} + +static int vevif_local_register_callback(const struct device *dev, uint32_t id, mbox_callback_t cb, + void *user_data) +{ + ARG_UNUSED(dev); + + if (!vevif_local_is_task_valid(id)) { + return -EINVAL; + } + + cbs.cb[id] = cb; + cbs.user_data[id] = user_data; + + return 0; +} + +static int vevif_local_set_enabled(const struct device *dev, uint32_t id, bool enable) +{ + ARG_UNUSED(dev); + + if (!vevif_local_is_task_valid(id)) { + return -EINVAL; + } + + if (enable) { + if ((cbs.enabled_mask & BIT(id)) != 0U) { + return -EALREADY; + } + + cbs.enabled_mask |= BIT(id); + irq_enable(vevif_irqs[id]); + } else { + if ((cbs.enabled_mask & BIT(id)) == 0U) { + return -EALREADY; + } + + cbs.enabled_mask &= ~BIT(id); + irq_disable(vevif_irqs[id]); + } + + return 0; +} + +static const struct mbox_driver_api vevif_local_driver_api = { + .max_channels_get = vevif_local_max_channels_get, + .register_callback = vevif_local_register_callback, + .set_enabled = vevif_local_set_enabled, +}; + +#define VEVIF_IRQ_CONNECT(idx, _) \ + IRQ_CONNECT(DT_INST_IRQ_BY_IDX(0, idx, irq), DT_INST_IRQ_BY_IDX(0, idx, priority), \ + vevif_local_isr, &vevif_irqs[idx], 0) + +static int vevif_local_init(const struct device *dev) +{ + nrf_vpr_csr_vevif_tasks_clear(NRF_VPR_TASK_TRIGGER_ALL_MASK); + + LISTIFY(DT_NUM_IRQS(DT_DRV_INST(0)), VEVIF_IRQ_CONNECT, (;)); + + return 0; +} + +DEVICE_DT_INST_DEFINE(0, vevif_local_init, NULL, NULL, NULL, POST_KERNEL, CONFIG_MBOX_INIT_PRIORITY, + &vevif_local_driver_api); diff --git a/drivers/mbox/mbox_nrf_vevif_task_tx.c b/drivers/mbox/mbox_nrf_vevif_remote.c similarity index 52% rename from drivers/mbox/mbox_nrf_vevif_task_tx.c rename to drivers/mbox/mbox_nrf_vevif_remote.c index 6aac7522617..cb5d7c507c5 100644 --- a/drivers/mbox/mbox_nrf_vevif_task_tx.c +++ b/drivers/mbox/mbox_nrf_vevif_remote.c @@ -3,37 +3,31 @@ * SPDX-License-Identifier: Apache-2.0 */ -#define DT_DRV_COMPAT nordic_nrf_vevif_task_tx +#define DT_DRV_COMPAT nordic_nrf_vevif_remote #include #include #include -#if defined(CONFIG_SOC_NRF54L15_ENGA_CPUAPP) -#define TASKS_IDX_MAX 17U -#else -#define TASKS_IDX_MAX NRF_VPR_TASKS_TRIGGER_MAX -#endif - -struct mbox_vevif_task_tx_conf { +struct mbox_vevif_remote_conf { NRF_VPR_Type *vpr; uint32_t tasks_mask; uint8_t tasks; }; -static inline bool vevif_task_tx_is_valid(const struct device *dev, uint32_t id) +static inline bool vevif_remote_is_task_valid(const struct device *dev, uint32_t id) { - const struct mbox_vevif_task_tx_conf *config = dev->config; + const struct mbox_vevif_remote_conf *config = dev->config; - return ((id <= TASKS_IDX_MAX) && ((config->tasks_mask & BIT(id)) != 0U)); + return (id < config->tasks) && ((config->tasks_mask & BIT(id)) != 0U); } -static int vevif_task_tx_send(const struct device *dev, uint32_t id, const struct mbox_msg *msg) +static int vevif_remote_send(const struct device *dev, uint32_t id, const struct mbox_msg *msg) { - const struct mbox_vevif_task_tx_conf *config = dev->config; + const struct mbox_vevif_remote_conf *config = dev->config; - if (!vevif_task_tx_is_valid(dev, id)) { + if (!vevif_remote_is_task_valid(dev, id)) { return -EINVAL; } @@ -46,37 +40,37 @@ static int vevif_task_tx_send(const struct device *dev, uint32_t id, const struc return 0; } -static int vevif_task_tx_mtu_get(const struct device *dev) +static int vevif_remote_mtu_get(const struct device *dev) { ARG_UNUSED(dev); return 0; } -static uint32_t vevif_task_tx_max_channels_get(const struct device *dev) +static uint32_t vevif_remote_max_channels_get(const struct device *dev) { - const struct mbox_vevif_task_tx_conf *config = dev->config; + const struct mbox_vevif_remote_conf *config = dev->config; return config->tasks; } -static const struct mbox_driver_api vevif_task_tx_driver_api = { - .send = vevif_task_tx_send, - .mtu_get = vevif_task_tx_mtu_get, - .max_channels_get = vevif_task_tx_max_channels_get, +static const struct mbox_driver_api vevif_remote_driver_api = { + .send = vevif_remote_send, + .mtu_get = vevif_remote_mtu_get, + .max_channels_get = vevif_remote_max_channels_get, }; -#define VEVIF_TASK_TX_DEFINE(inst) \ +#define VEVIF_REMOTE_DEFINE(inst) \ BUILD_ASSERT(DT_INST_PROP(inst, nordic_tasks) <= VPR_TASKS_TRIGGER_MaxCount, \ "Number of tasks exceeds maximum"); \ \ - static const struct mbox_vevif_task_tx_conf conf##inst = { \ + static const struct mbox_vevif_remote_conf conf##inst = { \ .vpr = (NRF_VPR_Type *)DT_INST_REG_ADDR(inst), \ .tasks = DT_INST_PROP(inst, nordic_tasks), \ .tasks_mask = DT_INST_PROP(inst, nordic_tasks_mask), \ }; \ \ DEVICE_DT_INST_DEFINE(inst, NULL, NULL, NULL, &conf##inst, POST_KERNEL, \ - CONFIG_MBOX_INIT_PRIORITY, &vevif_task_tx_driver_api); + CONFIG_MBOX_INIT_PRIORITY, &vevif_remote_driver_api); -DT_INST_FOREACH_STATUS_OKAY(VEVIF_TASK_TX_DEFINE) +DT_INST_FOREACH_STATUS_OKAY(VEVIF_REMOTE_DEFINE) diff --git a/drivers/mbox/mbox_nrf_vevif_task_rx.c b/drivers/mbox/mbox_nrf_vevif_task_rx.c deleted file mode 100644 index 8a4d81e0e6e..00000000000 --- a/drivers/mbox/mbox_nrf_vevif_task_rx.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#define DT_DRV_COMPAT nordic_nrf_vevif_task_rx - -#include -#include - -#include -#include -#include - -#if defined(CONFIG_SOC_NRF54L15_ENGA_CPUFLPR) -#define TASKS_IDX_MIN 11U -#define TASKS_IDX_MAX 17U -#else -#define TASKS_IDX_MIN NRF_VPR_TASKS_TRIGGER_MIN -#define TASKS_IDX_MAX NRF_VPR_TASKS_TRIGGER_MAX -#endif - -#define VEVIF_TASKS_NUM DT_INST_PROP(0, nordic_tasks) -#define VEVIF_TASKS_MASK DT_INST_PROP(0, nordic_tasks_mask) - -BUILD_ASSERT(VEVIF_TASKS_NUM <= VPR_TASKS_TRIGGER_MaxCount, "Number of tasks exceeds maximum"); -BUILD_ASSERT(VEVIF_TASKS_NUM == DT_NUM_IRQS(DT_DRV_INST(0)), "# IRQs != # tasks"); - -/* callbacks */ -struct mbox_vevif_task_rx_cbs { - mbox_callback_t cb[TASKS_IDX_MAX - TASKS_IDX_MIN + 1U]; - void *user_data[TASKS_IDX_MAX - TASKS_IDX_MIN + 1U]; - uint32_t enabled_mask; -}; - -static struct mbox_vevif_task_rx_cbs cbs; - -/* IRQ list */ -#define VEVIF_IRQN(idx, _) DT_INST_IRQ_BY_IDX(0, idx, irq) - -static const uint8_t vevif_irqs[VEVIF_TASKS_NUM] = { - LISTIFY(DT_NUM_IRQS(DT_DRV_INST(0)), VEVIF_IRQN, (,)) -}; - -static void vevif_task_rx_isr(const void *parameter) -{ - uint8_t channel = *(uint8_t *)parameter; - uint8_t idx = channel - TASKS_IDX_MIN; - - nrf_vpr_csr_vevif_tasks_clear(BIT(channel)); - - if (cbs.cb[idx] != NULL) { - cbs.cb[idx](DEVICE_DT_INST_GET(0), channel, cbs.user_data[idx], NULL); - } -} - -static inline bool vevif_task_rx_is_task_valid(uint32_t id) -{ - return ((id <= TASKS_IDX_MAX) && ((VEVIF_TASKS_MASK & BIT(id)) != 0U)); -} - -static uint32_t vevif_task_rx_max_channels_get(const struct device *dev) -{ - ARG_UNUSED(dev); - - return VEVIF_TASKS_NUM; -} - -static int vevif_task_rx_register_callback(const struct device *dev, uint32_t id, - mbox_callback_t cb, void *user_data) -{ - ARG_UNUSED(dev); - uint8_t idx = id - TASKS_IDX_MIN; - - if (!vevif_task_rx_is_task_valid(id)) { - return -EINVAL; - } - - cbs.cb[idx] = cb; - cbs.user_data[idx] = user_data; - - return 0; -} - -static int vevif_task_rx_set_enabled(const struct device *dev, uint32_t id, bool enable) -{ - ARG_UNUSED(dev); - uint8_t idx = id - TASKS_IDX_MIN; - - if (!vevif_task_rx_is_task_valid(id)) { - return -EINVAL; - } - - if (enable) { - if ((cbs.enabled_mask & BIT(id)) != 0U) { - return -EALREADY; - } - - cbs.enabled_mask |= BIT(id); - irq_enable(vevif_irqs[idx]); - } else { - if ((cbs.enabled_mask & BIT(id)) == 0U) { - return -EALREADY; - } - - cbs.enabled_mask &= ~BIT(id); - irq_disable(vevif_irqs[idx]); - } - - return 0; -} - -static const struct mbox_driver_api vevif_task_rx_driver_api = { - .max_channels_get = vevif_task_rx_max_channels_get, - .register_callback = vevif_task_rx_register_callback, - .set_enabled = vevif_task_rx_set_enabled, -}; - -#define VEVIF_IRQ_CONNECT(idx, _) \ - IRQ_CONNECT(DT_INST_IRQ_BY_IDX(0, idx, irq), DT_INST_IRQ_BY_IDX(0, idx, priority), \ - vevif_task_rx_isr, &vevif_irqs[idx], 0) - -static int vevif_task_rx_init(const struct device *dev) -{ - nrf_vpr_csr_vevif_tasks_clear(NRF_VPR_TASK_TRIGGER_ALL_MASK); - - LISTIFY(DT_NUM_IRQS(DT_DRV_INST(0)), VEVIF_IRQ_CONNECT, (;)); - - return 0; -} - -DEVICE_DT_INST_DEFINE(0, vevif_task_rx_init, NULL, NULL, NULL, POST_KERNEL, - CONFIG_MBOX_INIT_PRIORITY, &vevif_task_rx_driver_api); diff --git a/dts/bindings/mbox/nordic,nrf-bellboard-rx.yaml b/dts/bindings/mbox/nordic,nrf-bellboard-local.yaml similarity index 88% rename from dts/bindings/mbox/nordic,nrf-bellboard-rx.yaml rename to dts/bindings/mbox/nordic,nrf-bellboard-local.yaml index 77bba202f52..5c1709987cc 100644 --- a/dts/bindings/mbox/nordic,nrf-bellboard-rx.yaml +++ b/dts/bindings/mbox/nordic,nrf-bellboard-local.yaml @@ -6,13 +6,13 @@ description: | BELLBOARD provides support for inter-domain software signaling. It implements a set of tasks and events intended for signaling within an interprocessor - communication (IPC) framework. When used in the rx mode, the BELLBOARD + communication (IPC) framework. When used in local mode, the BELLBOARD instance is used to receive events triggered by other remote cores. Example definition: bellboard: mailbox@deadbeef { - compatible = "nordic,nrf-bellboard-rx"; + compatible = "nordic,nrf-bellboard-local"; reg = <0xdeadbeef 0x1000>; interrupts = <98 NRF_DEFAULT_IRQ_PRIORITY>, <99 NRF_DEFAULT_IRQ_PRIORITY>; @@ -21,7 +21,7 @@ description: | #mbox-cells = <1>; }; -compatible: "nordic,nrf-bellboard-rx" +compatible: "nordic,nrf-bellboard-local" include: "nordic,nrf-bellboard-common.yaml" diff --git a/dts/bindings/mbox/nordic,nrf-bellboard-tx.yaml b/dts/bindings/mbox/nordic,nrf-bellboard-remote.yaml similarity index 76% rename from dts/bindings/mbox/nordic,nrf-bellboard-tx.yaml rename to dts/bindings/mbox/nordic,nrf-bellboard-remote.yaml index 95efcdededf..ae17fc916a1 100644 --- a/dts/bindings/mbox/nordic,nrf-bellboard-tx.yaml +++ b/dts/bindings/mbox/nordic,nrf-bellboard-remote.yaml @@ -6,17 +6,17 @@ description: | BELLBOARD provides support for inter-domain software signaling. It implements a set of tasks and events intended for signaling within an interprocessor - communication (IPC) framework. When used in the tx mode, the BELLBOARD + communication (IPC) framework. When used in remote mode, the BELLBOARD instance is used to trigger events to another core. Example definition: bellboard: mailbox@deadbeef { - compatible = "nordic,nrf-bellboard-tx"; + compatible = "nordic,nrf-bellboard-remote"; reg = <0xdeadbeef 0x1000>; #mbox-cells = <1>; }; -compatible: "nordic,nrf-bellboard-tx" +compatible: "nordic,nrf-bellboard-remote" include: "nordic,nrf-bellboard-common.yaml" diff --git a/dts/bindings/mbox/nordic,nrf-vevif-common.yaml b/dts/bindings/mbox/nordic,nrf-vevif-common.yaml new file mode 100644 index 00000000000..b7cb15457f6 --- /dev/null +++ b/dts/bindings/mbox/nordic,nrf-vevif-common.yaml @@ -0,0 +1,18 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +include: mailbox-controller.yaml + +properties: + nordic,tasks: + type: int + required: true + description: Number of tasks supported by the VEVIF instance. + + nordic,tasks-mask: + type: int + required: true + description: Mask of tasks supported by the VEVIF instance. + +mbox-cells: + - channel diff --git a/dts/bindings/mbox/nordic,nrf-vevif-local.yaml b/dts/bindings/mbox/nordic,nrf-vevif-local.yaml new file mode 100644 index 00000000000..5d23cfdcf1e --- /dev/null +++ b/dts/bindings/mbox/nordic,nrf-vevif-local.yaml @@ -0,0 +1,32 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: | + Nordic VEVIF (VPR Event Interface) - Local + + VEVIF is an event interface for VPR, allowing connection to the domain's DPPI + system. VEVIF can also generate IRQs to other CPUs. + + Example definition: + + cpuppr: cpu@d { + ... + cpuppr_vevif_local: mailbox { + compatible = "nordic,nrf-vevif-local"; + interrupts = <0 NRF_DEFAULT_IRQ_PRIORITY>, + <1 NRF_DEFAULT_IRQ_PRIORITY>, + ... + ; + #mbox-cells = <1>; + nordic,tasks = <16>; + nordic,tasks-mask: <0xfffffff0>; + }; + }; + +compatible: "nordic,nrf-vevif-local" + +include: [base.yaml, "nordic,nrf-vevif-common.yaml"] + +properties: + interrupts: + required: true diff --git a/dts/bindings/mbox/nordic,nrf-vevif-remote.yaml b/dts/bindings/mbox/nordic,nrf-vevif-remote.yaml new file mode 100644 index 00000000000..07522fed99d --- /dev/null +++ b/dts/bindings/mbox/nordic,nrf-vevif-remote.yaml @@ -0,0 +1,29 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: | + Nordic VEVIF (VPR Event Interface) - Remote + + VEVIF is an event interface for VPR, allowing connection to the domain's DPPI + system. VEVIF can also generate IRQs to other CPUs. + + Example definition: + + cpuppr_vpr: vpr@deadbeef{ + ... + cpuppr_vevif_remote: mailbox@0 { + compatible = "nordic,nrf-vevif-remote"; + reg = <0x0 0x1000>; + #mbox-cells = <1>; + nordic,tasks = <16>; + nordic,tasks-mask: <0xfffffff0>; + }; + }; + +compatible: "nordic,nrf-vevif-remote" + +include: [base.yaml, "nordic,nrf-vevif-common.yaml"] + +properties: + reg: + required: true diff --git a/dts/bindings/mbox/nordic,nrf-vevif-task-rx.yaml b/dts/bindings/mbox/nordic,nrf-vevif-task-rx.yaml deleted file mode 100644 index 98304c83474..00000000000 --- a/dts/bindings/mbox/nordic,nrf-vevif-task-rx.yaml +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - Nordic VEVIF (VPR Event Interface) - TASK RX MODE - - VEVIF is an event interface for VPR, allowing connection to the domain's DPPI - system. VEVIF can also generate IRQs to other CPUs. - - VEVIF provides support for inter-domain software signaling. It implements a set of tasks - intended for signaling within an interprocessor communication (IPC) framework. - When used in task rx mode, the VEVIF tasks are used to receive events triggered by other core. - - Example definition: - - cpuppr: cpu@d { - ... - cpuppr_vevif_task_rx: mailbox { - compatible = "nordic,nrf-vevif-task-rx"; - interrupts = <0 NRF_DEFAULT_IRQ_PRIORITY>, - <1 NRF_DEFAULT_IRQ_PRIORITY>, - ... - ; - #mbox-cells = <1>; - nordic,tasks = <16>; - nordic,tasks-mask = <0xfffffff0>; - }; - }; - -compatible: "nordic,nrf-vevif-task-rx" - -include: [base.yaml, mailbox-controller.yaml] - -properties: - nordic,tasks: - type: int - required: true - description: Number of tasks supported by the VEVIF instance. - - nordic,tasks-mask: - type: int - required: true - description: Mask of tasks supported by the VEVIF instance. - - interrupts: - required: true - -mbox-cells: - - channel diff --git a/dts/bindings/mbox/nordic,nrf-vevif-task-tx.yaml b/dts/bindings/mbox/nordic,nrf-vevif-task-tx.yaml deleted file mode 100644 index d8f603854cb..00000000000 --- a/dts/bindings/mbox/nordic,nrf-vevif-task-tx.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - Nordic VEVIF (VPR Event Interface) - TASK TX MODE - - VEVIF is an event interface for VPR, allowing connection to the domain's DPPI - system. VEVIF can also generate IRQs to other CPUs. - - VEVIF provides support for inter-domain software signaling. It implements a set of tasks - intended for signaling within an interprocessor communication (IPC) framework. - When used in task tx mode, the VEVIF tasks are used to trigger IRQs on VPR core. - - Example definition: - - cpuppr_vpr: vpr@deadbeef{ - ... - cpuppr_vevif_task_tx: mailbox@0 { - compatible = "nordic,nrf-vevif-task-tx"; - reg = <0x0 0x1000>; - #mbox-cells = <1>; - nordic,tasks = <16>; - nordic,tasks-mask = <0xfffffff0>; - }; - }; - -compatible: "nordic,nrf-vevif-task-tx" - -include: [base.yaml, mailbox-controller.yaml] - -properties: - nordic,tasks: - type: int - required: true - description: Number of tasks supported by the VEVIF instance. - - nordic,tasks-mask: - type: int - required: true - description: Mask of tasks supported by the VEVIF instance. - - reg: - required: true - -mbox-cells: - - channel From 4f19bd994554d528dc35afde1120a2dbe9e1a3ed Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:07 +0200 Subject: [PATCH 319/825] Revert "[nrf fromtree] drivers: mbox: add initial driver for nRF VEVIF event" This reverts commit 4e9f725ed1265085795ba151452c27ca24b34db5. --- drivers/mbox/CMakeLists.txt | 2 - drivers/mbox/Kconfig | 1 - drivers/mbox/Kconfig.nrf_vevif_event | 16 -- drivers/mbox/mbox_nrf_vevif_event_rx.c | 152 ------------------ drivers/mbox/mbox_nrf_vevif_event_tx.c | 70 -------- .../mbox/nordic,nrf-vevif-event-rx.yaml | 48 ------ .../mbox/nordic,nrf-vevif-event-tx.yaml | 40 ----- 7 files changed, 329 deletions(-) delete mode 100644 drivers/mbox/Kconfig.nrf_vevif_event delete mode 100644 drivers/mbox/mbox_nrf_vevif_event_rx.c delete mode 100644 drivers/mbox/mbox_nrf_vevif_event_tx.c delete mode 100644 dts/bindings/mbox/nordic,nrf-vevif-event-rx.yaml delete mode 100644 dts/bindings/mbox/nordic,nrf-vevif-event-tx.yaml diff --git a/drivers/mbox/CMakeLists.txt b/drivers/mbox/CMakeLists.txt index 1c71d696d14..1d5c65cded7 100644 --- a/drivers/mbox/CMakeLists.txt +++ b/drivers/mbox/CMakeLists.txt @@ -12,7 +12,5 @@ zephyr_library_sources_ifdef(CONFIG_MBOX_NXP_MAILBOX mbox_nxp_mailbox.c) zephyr_library_sources_ifdef(CONFIG_MBOX_ANDES_PLIC_SW mbox_andes_plic_sw.c) zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_VEVIF_LOCAL mbox_nrf_vevif_local.c) zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_VEVIF_REMOTE mbox_nrf_vevif_remote.c) -zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_VEVIF_EVENT_RX mbox_nrf_vevif_event_rx.c) -zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_VEVIF_EVENT_TX mbox_nrf_vevif_event_tx.c) zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_BELLBOARD_LOCAL mbox_nrf_bellboard_local.c) zephyr_library_sources_ifdef(CONFIG_MBOX_NRF_BELLBOARD_REMOTE mbox_nrf_bellboard_remote.c) diff --git a/drivers/mbox/Kconfig b/drivers/mbox/Kconfig index 4f0a8e627fe..7f00324ba47 100644 --- a/drivers/mbox/Kconfig +++ b/drivers/mbox/Kconfig @@ -18,7 +18,6 @@ source "drivers/mbox/Kconfig.nxp_imx" source "drivers/mbox/Kconfig.nxp_mailbox" source "drivers/mbox/Kconfig.andes" source "drivers/mbox/Kconfig.nrf_vevif" -source "drivers/mbox/Kconfig.nrf_vevif_event" source "drivers/mbox/Kconfig.nrf_bellboard" config MBOX_INIT_PRIORITY diff --git a/drivers/mbox/Kconfig.nrf_vevif_event b/drivers/mbox/Kconfig.nrf_vevif_event deleted file mode 100644 index c9d634dac82..00000000000 --- a/drivers/mbox/Kconfig.nrf_vevif_event +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config MBOX_NRF_VEVIF_EVENT_RX - bool "nRF VEVIF event RX driver" - depends on DT_HAS_NORDIC_NRF_VEVIF_EVENT_RX_ENABLED - default y - help - Mailbox driver for receiving events triggered by VPR - -config MBOX_NRF_VEVIF_EVENT_TX - bool "nRF VEVIF event TX driver" - depends on DT_HAS_NORDIC_NRF_VEVIF_EVENT_TX_ENABLED - default y - help - Mailbox driver for transmitting events from VPR to a remote core diff --git a/drivers/mbox/mbox_nrf_vevif_event_rx.c b/drivers/mbox/mbox_nrf_vevif_event_rx.c deleted file mode 100644 index a7ec6dd9fff..00000000000 --- a/drivers/mbox/mbox_nrf_vevif_event_rx.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#define DT_DRV_COMPAT nordic_nrf_vevif_event_rx - -#include -#include - -#include - -#if defined(CONFIG_SOC_NRF54L15_ENGA_CPUAPP) -#define EVENTS_IDX_MIN 11U -#define EVENTS_IDX_MAX 17U -#else -#define EVENTS_IDX_MIN NRF_VPR_EVENTS_TRIGGERED_MIN -#define EVENTS_IDX_MAX NRF_VPR_EVENTS_TRIGGERED_MAX -#endif - -/* callbacks */ -struct mbox_vevif_event_rx_cbs { - mbox_callback_t cb[EVENTS_IDX_MAX - EVENTS_IDX_MIN + 1U]; - void *user_data[EVENTS_IDX_MAX - EVENTS_IDX_MIN + 1U]; - uint32_t enabled_mask; -}; - -struct mbox_vevif_event_rx_conf { - NRF_VPR_Type *vpr; - uint32_t events_mask; - uint8_t events; - void (*irq_connect)(void); -}; - -static void vevif_event_rx_isr(const void *device) -{ - const struct device *dev = (struct device *)device; - const struct mbox_vevif_event_rx_conf *config = dev->config; - struct mbox_vevif_event_rx_cbs *cbs = dev->data; - - for (uint8_t id = EVENTS_IDX_MIN; id < EVENTS_IDX_MAX + 1U; id++) { - nrf_vpr_event_t event = nrfy_vpr_triggered_event_get(id); - - if (nrfy_vpr_event_check(config->vpr, event)) { - nrfy_vpr_event_clear(config->vpr, event); - uint8_t idx = id - EVENTS_IDX_MIN; - - if ((cbs->enabled_mask & BIT(id)) && (cbs->cb[idx] != NULL)) { - cbs->cb[idx](dev, id, cbs->user_data[idx], NULL); - } - } - } -} - -static inline bool vevif_event_rx_event_is_valid(uint32_t events_mask, uint32_t id) -{ - return ((id <= EVENTS_IDX_MAX) && ((events_mask & BIT(id)) != 0U)); -} - -static uint32_t vevif_event_rx_max_channels_get(const struct device *dev) -{ - const struct mbox_vevif_event_rx_conf *config = dev->config; - - return config->events; -} - -static int vevif_event_rx_register_callback(const struct device *dev, uint32_t id, - mbox_callback_t cb, void *user_data) -{ - const struct mbox_vevif_event_rx_conf *config = dev->config; - struct mbox_vevif_event_rx_cbs *cbs = dev->data; - uint8_t idx = id - EVENTS_IDX_MIN; - - if (!vevif_event_rx_event_is_valid(config->events_mask, id)) { - return -EINVAL; - } - - cbs->cb[idx] = cb; - cbs->user_data[idx] = user_data; - - return 0; -} - -static int vevif_event_rx_set_enabled(const struct device *dev, uint32_t id, bool enable) -{ - const struct mbox_vevif_event_rx_conf *config = dev->config; - struct mbox_vevif_event_rx_cbs *cbs = dev->data; - - if (!vevif_event_rx_event_is_valid(config->events_mask, id)) { - return -EINVAL; - } - - if (enable) { - if ((cbs->enabled_mask & BIT(id)) != 0U) { - return -EALREADY; - } - - cbs->enabled_mask |= BIT(id); - nrfy_vpr_int_enable(config->vpr, BIT(id)); - } else { - if ((cbs->enabled_mask & BIT(id)) == 0U) { - return -EALREADY; - } - - cbs->enabled_mask &= ~BIT(id); - nrfy_vpr_int_disable(config->vpr, BIT(id)); - } - - return 0; -} - -static const struct mbox_driver_api vevif_event_rx_driver_api = { - .max_channels_get = vevif_event_rx_max_channels_get, - .register_callback = vevif_event_rx_register_callback, - .set_enabled = vevif_event_rx_set_enabled, -}; - -static int vevif_event_rx_init(const struct device *dev) -{ - const struct mbox_vevif_event_rx_conf *config = dev->config; - - config->irq_connect(); - - return 0; -} - -#define VEVIF_EVENT_RX_DEFINE(inst) \ - BUILD_ASSERT(DT_INST_PROP(inst, nordic_events) <= NRF_VPR_EVENTS_TRIGGERED_COUNT, \ - "Number of events exceeds maximum"); \ - \ - static void irq_connect##inst(void) \ - { \ - IRQ_CONNECT(DT_IRQN(DT_DRV_INST(inst)), DT_IRQ(DT_DRV_INST(inst), priority), \ - vevif_event_rx_isr, (const void *)DEVICE_DT_GET(DT_DRV_INST(inst)), \ - 0); \ - irq_enable(DT_IRQN(DT_DRV_INST(inst))); \ - }; \ - \ - static struct mbox_vevif_event_rx_cbs data##inst = { \ - .enabled_mask = 0, \ - }; \ - static const struct mbox_vevif_event_rx_conf conf##inst = { \ - .vpr = (NRF_VPR_Type *)DT_INST_REG_ADDR(inst), \ - .events = DT_INST_PROP(inst, nordic_events), \ - .events_mask = DT_INST_PROP(inst, nordic_events_mask), \ - .irq_connect = irq_connect##inst, \ - }; \ - \ - DEVICE_DT_INST_DEFINE(inst, vevif_event_rx_init, NULL, &data##inst, &conf##inst, \ - POST_KERNEL, CONFIG_MBOX_INIT_PRIORITY, &vevif_event_rx_driver_api); - -DT_INST_FOREACH_STATUS_OKAY(VEVIF_EVENT_RX_DEFINE) diff --git a/drivers/mbox/mbox_nrf_vevif_event_tx.c b/drivers/mbox/mbox_nrf_vevif_event_tx.c deleted file mode 100644 index e323a07bb7d..00000000000 --- a/drivers/mbox/mbox_nrf_vevif_event_tx.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: Apache-2.0 - */ - -#define DT_DRV_COMPAT nordic_nrf_vevif_event_tx - -#include -#include - -#include -#include -#include - -#if defined(CONFIG_SOC_NRF54L15_ENGA_CPUFLPR) -#define EVENTS_IDX_MAX 17U -#else -#define EVENTS_IDX_MAX NRF_VPR_EVENTS_TRIGGERED_MAX -#endif - -#define VEVIF_EVENTS_NUM DT_INST_PROP(0, nordic_events) -#define VEVIF_EVENTS_MASK DT_INST_PROP(0, nordic_events_mask) - -BUILD_ASSERT(DT_INST_PROP(0, nordic_events) <= NRF_VPR_EVENTS_TRIGGERED_COUNT, - "Number of events exceeds maximum"); - -static inline bool vevif_event_tx_is_valid(uint32_t id) -{ - return (id < EVENTS_IDX_MAX) && ((VEVIF_EVENTS_MASK & BIT(id)) != 0U); -} - -static int vevif_event_tx_send(const struct device *dev, uint32_t id, const struct mbox_msg *msg) -{ - ARG_UNUSED(dev); - - if (!vevif_event_tx_is_valid(id)) { - return -EINVAL; - } - - if (msg != NULL) { - return -ENOTSUP; - } - - nrf_vpr_csr_vevif_events_trigger(BIT(id)); - - return 0; -} - -static int vevif_event_tx_mtu_get(const struct device *dev) -{ - ARG_UNUSED(dev); - - return 0; -} - -static uint32_t vevif_event_tx_max_channels_get(const struct device *dev) -{ - ARG_UNUSED(dev); - - return VEVIF_EVENTS_NUM; -} - -static const struct mbox_driver_api vevif_event_tx_driver_api = { - .send = vevif_event_tx_send, - .mtu_get = vevif_event_tx_mtu_get, - .max_channels_get = vevif_event_tx_max_channels_get, -}; - -DEVICE_DT_INST_DEFINE(0, NULL, NULL, NULL, NULL, POST_KERNEL, CONFIG_MBOX_INIT_PRIORITY, - &vevif_event_tx_driver_api); diff --git a/dts/bindings/mbox/nordic,nrf-vevif-event-rx.yaml b/dts/bindings/mbox/nordic,nrf-vevif-event-rx.yaml deleted file mode 100644 index 9fa9b9bd090..00000000000 --- a/dts/bindings/mbox/nordic,nrf-vevif-event-rx.yaml +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - Nordic VEVIF (VPR Event Interface) - EVENT RX MODE - - VEVIF provides support for inter-domain software signaling. It implements a set of events - intended for signaling within the interprocessor communication (IPC) framework. - When used in the event rx mode, the VEVIF events are used to receive IRQs that are - triggered by the VPR core. - - Example definition: - - cpuppr_vpr: vpr@deadbeef { - ... - cpuflpr_vevif_event_rx: mailbox@0 { - compatible = "nordic,nrf-vevif-event-rx"; - reg = <0x0 0x1000>; - interrupts = <76 NRF_DEFAULT_IRQ_PRIORITY>; - #mbox-cells = <1>; - nordic,events = <1>; - nordic,events-mask = <0x00008000>; - }; - }; - -compatible: "nordic,nrf-vevif-event-rx" - -include: [base.yaml, mailbox-controller.yaml] - -properties: - nordic,events: - type: int - required: true - description: Number of events supported by the VEVIF instance. - - nordic,events-mask: - type: int - required: true - description: Mask of events supported by the VEVIF instance. - - interrupts: - required: true - - reg: - required: true - -mbox-cells: - - channel diff --git a/dts/bindings/mbox/nordic,nrf-vevif-event-tx.yaml b/dts/bindings/mbox/nordic,nrf-vevif-event-tx.yaml deleted file mode 100644 index eda99886c18..00000000000 --- a/dts/bindings/mbox/nordic,nrf-vevif-event-tx.yaml +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -description: | - Nordic VEVIF (VPR Event Interface) - EVENT TX MODE - - VEVIF provides support for inter-domain software signaling. It implements a set of events - intended for signaling within the interprocessor communication (IPC) framework. - When used in the event tx mode, the VEVIF events are used to trigger IRQs from VPR - to a remote core. - - Example definition: - - cpuppr_vpr: vpr@deadbeef{ - ... - cpuflpr_vevif_event_tx: mailbox { - compatible = "nordic,nrf-vevif-event-tx"; - #mbox-cells = <1>; - nordic,events = <1>; - nordic,events-mask = <0x00008000>; - }; - }; - -compatible: "nordic,nrf-vevif-event-tx" - -include: [base.yaml, mailbox-controller.yaml] - -properties: - nordic,events: - type: int - required: true - description: Number of events supported by the VEVIF instance. - - nordic,events-mask: - type: int - required: true - description: Mask of events supported by the VEVIF instance. - -mbox-cells: - - channel From 44bd8cf2f6f3a520ce18504d36523afd4fa097c5 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:07 +0200 Subject: [PATCH 320/825] Revert "[nrf noup] soc: nrf54l: Add custom section for KMU" This reverts commit 38452400d3bed75faf30b5a0e4a5a34d9a44128b. --- 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 bf2eaa1d820..f1c18291fc6 100644 --- a/soc/nordic/nrf54l/CMakeLists.txt +++ b/soc/nordic/nrf54l/CMakeLists.txt @@ -10,12 +10,3 @@ zephyr_include_directories(.) if(CONFIG_ELV_GRTC_LFXO_ALLOWED) message(WARNING "WARNING! ELV mode feature is EXPERIMENTAL and may brick your device!") endif() - -# 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) -# 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 2fff571ffce9cc5d5f5797a1b96c5064b2331039 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:07 +0200 Subject: [PATCH 321/825] Revert "[nrf fromlist] modules: hal_nordic: nrfx: Add nrfx_config_ext.h" This reverts commit d12380d2584d6f58c834be8953874ef24fd83fe9. --- modules/hal_nordic/nrfx/nrfx_config.h | 2 +- modules/hal_nordic/nrfx/nrfx_config_ext.h | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 modules/hal_nordic/nrfx/nrfx_config_ext.h diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index a66cacc148e..a54866252a5 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -1026,7 +1026,7 @@ #elif defined(NRF9120_XXAA) || defined(NRF9160_XXAA) #include #else - #include + #error "Unknown device." #endif #endif // NRFX_CONFIG_H__ diff --git a/modules/hal_nordic/nrfx/nrfx_config_ext.h b/modules/hal_nordic/nrfx/nrfx_config_ext.h deleted file mode 100644 index 9110b2fa7a9..00000000000 --- a/modules/hal_nordic/nrfx/nrfx_config_ext.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2023 - 2024, Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef NRFX_CONFIG_EXT_H__ -#define NRFX_CONFIG_EXT_H__ - -#error "Unknown device." - -#endif /* NRFX_CONFIG_EXT_H__ */ From 9c9f4a12935aa3a6f5adfa17c63fe48327805f2c Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 20:03:07 +0200 Subject: [PATCH 322/825] Revert "[nrf fromlist] sysbuild: dts: Introduce sysbuild_dt_* API" This reverts commit 1e0d97577b1ae6b1ca80b8c65906e4bbeddaba13. --- cmake/modules/extensions.cmake | 71 +++------------- .../cmake/modules/sysbuild_extensions.cmake | 85 ------------------- 2 files changed, 12 insertions(+), 144 deletions(-) diff --git a/cmake/modules/extensions.cmake b/cmake/modules/extensions.cmake index cd431147431..52bb28b0b47 100644 --- a/cmake/modules/extensions.cmake +++ b/cmake/modules/extensions.cmake @@ -3553,9 +3553,6 @@ endfunction() # alias at the beginning of a path interchangeably with the full # path to the aliased node in these functions. The usage comments # will make this clear in each case. -# -# - Each of these methods also has a sysbuild_dt_* counterpart. -# See share/sysbuild/cmake/modules/sysbuild_extensions.cmake. # Usage: # dt_nodelabel( NODELABEL

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

7Q8{Kg>p$t?pK%@fJgRpB)SPGAHye7)zoK_jf zuy`^`h~Or~Q35;K-)0tp49K2#bxF&u;ZvhS=Y3&d?9O$hQ7{9#t--XtwiQ5L9*lS_ zjNAVI0Hz?c0{(HfLQGBY0e17e66#5Efgq(5o^S>|PcHGO5EXZ!eeHt*H!dblclpUq z{{R>pt8%FZhn}#Vk7H4n&v{5`-Ay?2a&~2pslBj%*OfVI&@y={3&r_!W zJoaPE(oB5u*0FRJXAWTb!Q5{-E|)hC)Sa!U>ARb5IhCN;7xvU zJ}K)Rtoy@{c{$z%c-xdN>5`v2&i=TpSo4E_I)i5j0Xbd)tO%?fL^;Sg1=#N;xcH$$ zqN^y=jp4;rMjDcRr9+Yn@rGBL{{V7ExJ7K; zn7vzl6-p3jl#SyzF@fV0ZlF|30=!|^Xm$@zr#B^n)y!aPaPG814i)(`WBbBF`R6R! z0^%{Zhk)-GCRVBM9GAmEtK7#RN@7X00MOU0;}Y*GLXd(+9dH+g)sWK76hot3WP?V^ z5diG`8u(QZXuuUC@1>%J|I6T(!y2T18 zWrLmCF7KBM3aSF6DHh&drf~`b{{ZlkW6eTCvo2g7=ligr?XK~3b>j`TKOS&K^kf{B zG(@DN?2YddZ9IoMrag$>HHP$#jY4jKZFCqChhf6J{_(|TAXgTW^x_q13Kx3~3E6L0 z^g%0DF4B>`uMR+RDS$eFp;uP$H~10uGPD(Wy2;E35McJfeSj-pUxa#&^s96*4inpkn2t+~X$iMWK^`_6|{-9?`xP zX1usTu9bhVI z&V}2#qjXIeqAuwnwJ=>v>kB6xm3s%I(Ky>?Yn4MG({gcx%1CY-^yS+(PKL>}BO4p} z!RfOW!`!SyjXLVMWgr`t1TQ<`teoOShoKo4Qg?$7Y|SZi1@05&cPV)82l~P-4DpE@ zJ>|NyHp019A*mXv0z2y#uM;cJ2PuB0K0(zWn*mzQmEIyy5#U4XdEcV&kSIZEo9dAu z{{UE&0x|ypTi7KsXP^OH+>9e)=ic~f3i z>b)8>o{p>_MY|_iI8=V%{>TYu?bZ;mbRM$d zR+RDo0GKKQTiidqX|Sl*Q_ed!0Ra8Ju^?`~6wMQ)n&VvKT7LQZ#*>mLd&|1C!<2); z&Iu8|v4#=L!J9nyilrOg*yZfgxCH=+{ta3oDF4)MB4)E+RcmUl8lPm`R|LHrqB#p^`gNV@Nj z8K6y9CM$A&mh!IRbBelJgz3RBF0?5J8;P8m%Q#Q| zWI}4nTE5D6Lg7(CLOqLY9!CV2$bdW{ecmxdMBq{$5N~*r(x^v$@?vd$x%1~CBg%`g zGkR%%E-?{z2UwAO_&L5XCY=mN7DnOgjL`^3dg~N8Qt)?`pwMp!3RAO;^8P=LD2~xX zxJ(e6frHQ-VipZN4)JPnd1rXiZPKVB2=Kf<@SXb(BVZpqrUdzJKcQK6s+0KEFM++nC=+?1> zZ0FYub<8&09VGQN`^ZEB{eE){bZ4+Tv8`}TbLHAfjvlk5ZZYPS)17*58Z(8p{{Vhn zCHmHLiEeX;ld}*<;F2iq)?fAhKjG&)$2|W4$^B!G2mGJ@96A30hpc)0f5*T7*`*4~ An*aa+ literal 0 HcmV?d00001 diff --git a/boards/shields/nrf7002eb/nrf7002eb.overlay b/boards/shields/nrf7002eb/nrf7002eb.overlay new file mode 100644 index 00000000000..d580a2efb8c --- /dev/null +++ b/boards/shields/nrf7002eb/nrf7002eb.overlay @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + chosen { + zephyr,wifi = &wlan0; + }; +}; + +&edge_connector_spi { + status = "okay"; + + nrf70: nrf7002@0 { + compatible = "nordic,nrf7002-spi"; + status = "okay"; + reg = <0>; + spi-max-frequency = ; + + bucken-gpios = <&edge_connector 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; + iovdd-ctrl-gpios = <&edge_connector 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; + host-irq-gpios = <&edge_connector 19 GPIO_ACTIVE_HIGH>; + + wlan0: wlan0 { + compatible = "nordic,wlan"; + }; + + wifi-max-tx-pwr-2g-dsss = <21>; + wifi-max-tx-pwr-2g-mcs0 = <16>; + wifi-max-tx-pwr-2g-mcs7 = <16>; + wifi-max-tx-pwr-5g-low-mcs0 = <13>; + wifi-max-tx-pwr-5g-low-mcs7 = <13>; + wifi-max-tx-pwr-5g-mid-mcs0 = <13>; + wifi-max-tx-pwr-5g-mid-mcs7 = <13>; + wifi-max-tx-pwr-5g-high-mcs0 = <12>; + wifi-max-tx-pwr-5g-high-mcs7 = <12>; + }; +}; diff --git a/boards/shields/nrf7002eb/nrf7002eb_coex.overlay b/boards/shields/nrf7002eb/nrf7002eb_coex.overlay new file mode 100644 index 00000000000..a8925c25567 --- /dev/null +++ b/boards/shields/nrf7002eb/nrf7002eb_coex.overlay @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "nrf7002eb.overlay" + +&nrf70 { + status0-gpios = <&edge_connector 5 GPIO_ACTIVE_HIGH>; + req-gpios = <&edge_connector 6 GPIO_ACTIVE_HIGH>; + grant-gpios = <&edge_connector 15 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; +}; From 47665ad5872493593757f3f06b7979efffee2939 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Thu, 12 Sep 2024 10:43:45 +0200 Subject: [PATCH 815/825] [nrf fromlist] samples: net: wifi: add build of nrf7002eb Add build for nrf7002eb shield on thingy53 board. Signed-off-by: Bjarki Arge Andreasen Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/78330 --- samples/net/wifi/sample.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/samples/net/wifi/sample.yaml b/samples/net/wifi/sample.yaml index 694a4d68f92..1c106e4897a 100644 --- a/samples/net/wifi/sample.yaml +++ b/samples/net/wifi/sample.yaml @@ -62,3 +62,11 @@ tests: integration_platforms: - nrf5340dk/nrf5340/cpuapp - nucleo_h723zg + sample.net.wifi.nrf7002eb: + extra_args: + - CONFIG_NRF_WIFI_BUILD_ONLY_MODE=y + - SHIELD=nrf7002eb + platform_allow: + - thingy53/nrf5340/cpuapp + integration_platforms: + - thingy53/nrf5340/cpuapp From aa4b858f82018dcaa4656e2893ccf3f60c8a740a Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 7 May 2024 08:27:09 +0100 Subject: [PATCH 816/825] [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 --- 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 d5c0e6f3633b926cbbf30ebbe72076f751c49cb8 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 16 Sep 2024 15:42:48 +0200 Subject: [PATCH 817/825] [nrf fromlist] drivers: wifi: nrfwifi: determine shared iovdd and bucken from dt Currently a user, or a shield definition, must select a Kconfig to signal that the iovdd_ctrl and bucken GPIOs are connected to the same pin. We can instead check this in the driver by simply checking if the iovdd_ctrl_spec and bucken_spec are the same pin. Update the nrfwifi driver and remove the redundant NRF_WIFI_COMBINED_BUCKEN_IOVDD_GPIO config. Signed-off-by: Bjarki Arge Andreasen Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/78485 --- drivers/wifi/nrfwifi/Kconfig.nrfwifi | 7 ------- drivers/wifi/nrfwifi/src/qspi/src/rpu_hw_if.c | 3 ++- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/wifi/nrfwifi/Kconfig.nrfwifi b/drivers/wifi/nrfwifi/Kconfig.nrfwifi index cf423082b4e..d8cae0f38c8 100644 --- a/drivers/wifi/nrfwifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrfwifi/Kconfig.nrfwifi @@ -664,13 +664,6 @@ config NET_MGMT_EVENT_QUEUE_SIZE default 16 endif # NRF_WIFI_RPU_RECOVERY -config NRF_WIFI_COMBINED_BUCKEN_IOVDD_GPIO - bool - help - Enable this option to use a single GPIO to control both buck enable and IOVDD enable, - there will be a internal hardware switch to add delay between the two operations. This - is typically 4ms delay for nRF70. - config NRF_WIFI_FEAT_WMM bool "WMM/QoS support" default y diff --git a/drivers/wifi/nrfwifi/src/qspi/src/rpu_hw_if.c b/drivers/wifi/nrfwifi/src/qspi/src/rpu_hw_if.c index b8b45d7f811..c5f909b4c3a 100644 --- a/drivers/wifi/nrfwifi/src/qspi/src/rpu_hw_if.c +++ b/drivers/wifi/nrfwifi/src/qspi/src/rpu_hw_if.c @@ -242,7 +242,8 @@ static int rpu_pwron(void) /* Settling time for iovdd nRF7002 DK/EK - switch (TCK106AG): ~600us */ k_msleep(1); - if (IS_ENABLED(CONFIG_NRF_WIFI_COMBINED_BUCKEN_IOVDD_GPIO)) { + if ((bucken_spec.port == iovdd_ctrl_spec.port) && + (bucken_spec.pin == iovdd_ctrl_spec.pin)) { /* When a single GPIO is used, we need a total wait time after bucken assertion * to be 6ms (1ms + 1ms + 4ms). */ From 0f472565be5b0a948cb83ef394e1f868c0c85b80 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 6 Aug 2024 00:32:29 +0530 Subject: [PATCH 818/825] [nrf noup] modules: hostap: Use nRF security In NCS to leverage HW acceleration, use nRF security. Also, fix Kconfig warnings in NCS compliance for CRYPTO_ALT. Signed-off-by: Chaitanya Tata --- modules/hostap/CMakeLists.txt | 10 +++++-- modules/hostap/Kconfig | 50 ++++++++++++++++++++++++++++++++--- 2 files changed, 55 insertions(+), 5 deletions(-) diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index 1f30ee34416..4a756790f85 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -435,8 +435,10 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_DPP ${HOSTAP_SRC_BASE}/tls/asn1.c ) -# crypto mbedtls related -if(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO) +# crypto mbedtls related CRYPTO OR LEGACY_NCS +if(DEFINED CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO OR + DEFINED CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_LEGACY_NCS OR + DEFINED CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_LEGACY_NCS_PSA) zephyr_library_sources( ${HOSTAP_SRC_BASE}/crypto/crypto_mbedtls-bignum.c ${HOSTAP_SRC_BASE}/crypto/crypto_mbedtls-ec.c @@ -514,4 +516,8 @@ if(CONFIG_SAE_PWE_EARLY_EXIT) "please use it carefully and do not use it production.") endif() +zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ALT + MBEDTLS_NIST_KW_C +) + endif() diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index c49cee46973..f4c531e1d40 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -109,7 +109,8 @@ config WIFI_NM_WPA_SUPPLICANT_WEP choice WIFI_NM_WPA_SUPPLICANT_CRYPTO_BACKEND prompt "WPA supplicant crypto implementation" - default WIFI_NM_WPA_SUPPLICANT_CRYPTO_ALT + default WIFI_NM_WPA_SUPPLICANT_CRYPTO_LEGACY_NCS + default WIFI_NM_WPA_SUPPLICANT_CRYPTO_LEGACY_NCS_PSA if SOC_SERIES_NRF54LX help Select the crypto implementation to use for WPA supplicant. WIFI_NM_WPA_SUPPLICANT_CRYPTO_ALT supports enterprise mode @@ -149,20 +150,63 @@ config WIFI_NM_WPA_SUPPLICANT_CRYPTO_ALT select MBEDTLS_CIPHER select MBEDTLS_ECP_C select MBEDTLS_ECP_ALL_ENABLED - select MBEDTLS_CMAC + select MBEDTLS_CMAC_C select MBEDTLS_PKCS5_C select MBEDTLS_PK_WRITE_C select MBEDTLS_ECDH_C select MBEDTLS_ECDSA_C select MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED select MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED - select MBEDTLS_NIST_KW_C select MBEDTLS_DHM_C select MBEDTLS_HKDF_C select MBEDTLS_SERVER_NAME_INDICATION select MBEDTLS_X509_CRL_PARSE_C select MBEDTLS_TLS_VERSION_1_2 +config WIFI_NM_WPA_SUPPLICANT_CRYPTO_LEGACY_NCS + bool "Legacy Crypto support for WiFi using nRF security" + select MBEDTLS + select NRF_SECURITY + select MBEDTLS_CIPHER_MODE_CBC + select MBEDTLS_CIPHER_MODE_CTR + select MBEDTLS_LEGACY_CRYPTO_C + select MBEDTLS_SHA1_C + select MBEDTLS_ECP_C + select MBEDTLS_CTR_DRBG_C + select MBEDTLS_PK_C + select MBEDTLS_PKCS5_C + select MBEDTLS_PK_PARSE_C + select MBEDTLS_CMAC_C + select MBEDTLS_CIPHER_PADDING_PKCS7 + select MBEDTLS_PK_WRITE_C + select MBEDTLS_KEY_EXCHANGE_ALL_ENABLED + +config WIFI_NM_WPA_SUPPLICANT_CRYPTO_LEGACY_NCS_PSA + bool "PSA Crypto support for WiFi using nRF security" + select MBEDTLS + select NRF_SECURITY + select PSA_WANT_GENERATE_RANDOM + # Legacy crypto, still needed + select MBEDTLS_SHA1_C + select MBEDTLS_LEGACY_CRYPTO_C + select MBEDTLS_CMAC_C + select MBEDTLS_GCM_C + select MBEDTLS_TLS_LIBRARY + select MBEDTLS_PK_C + select MBEDTLS_PK_WRITE_C + select MBEDTLS_X509_LIBRARY + select MBEDTLS_X509_CRT_PARSE_C + select MBEDTLS_CIPHER_C + select MBEDTLS_CIPHER_MODE_CTR + select MBEDTLS_CIPHER_MODE_CBC + select MBEDTLS_SSL_TLS_C + select MBEDTLS_ECP_C + select MBEDTLS_CTR_DRBG_C + select MBEDTLS_KEY_EXCHANGE_ALL_ENABLED + select MBEDTLS_MD_C + select MBEDTLS_CIPHER_PADDING_PKCS7 + select MBEDTLS_PKCS5_C + config WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE bool "No Crypto support for WiFi" From 0f4425ea3eb1abfe6266ce2a592f80d708680079 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 5 Aug 2024 21:15:05 +0530 Subject: [PATCH 819/825] [nrf noup] drivers: wifi: nrfwifi: Workaround for build External flash support is still WIP, so, to get sysbuild working add dummy Kconfig options. Signed-off-by: Chaitanya Tata --- drivers/wifi/nrfwifi/Kconfig.nrfwifi | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/wifi/nrfwifi/Kconfig.nrfwifi b/drivers/wifi/nrfwifi/Kconfig.nrfwifi index d8cae0f38c8..797a7296d8e 100644 --- a/drivers/wifi/nrfwifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrfwifi/Kconfig.nrfwifi @@ -700,4 +700,31 @@ config NRF_WIFI_BUILD_ONLY_MODE dependency on firmware binary and patches. This is useful to check the build and link errors. +# TODO: Temporary WAR, implement these options in the future +config NRF_WIFI_PATCHES_EXT_FLASH_DISABLED + bool "nRF70 firmware patch external flash support" + help + Select this option to disable external flash support for nRF70 firmware patches + +config NRF_WIFI_FW_PATCH_DFU + bool "nRF70 firmware patch DFU" + help + Select this option to enable DFU for nRF70 firmware patches + +config NRF_WIFI_PATCHES_EXT_FLASH_STORE + bool "nRF70 firmware patch external flash store" + help + Select this option to enable external flash store for nRF70 firmware patches + +config NRF_WIFI_FW_FLASH_CHUNK_SIZE + int "nRF70 firmware patch flash chunk size" + default 8192 + help + Select this option to set the flash chunk size for nRF70 firmware patches + +config NRF_WIFI_PATCHES_EXT_FLASH_XIP + bool "nRF70 firmware patch external flash XIP" + help + Select this option to enable external flash XIP for nRF70 firmware patches + endif # WIFI_NRF70 From edb3e2ae55d5b678f9ffc80219b59b3aa2dd1462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Thu, 19 Sep 2024 15:35:52 +0200 Subject: [PATCH 820/825] [nrf noup] mbedtls: Add dependency logic for STREAM_CIPHER MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixup! [nrf noup] mbedtls: Add dependency logic for PSA crypto configurations -Selecting CHACHA20 key type if PSA_WANT_ALG_STREAM_CIPHER is enabled (fixup of commit 47a1e03564816790dfe6e737526b91f2ceae7934) Signed-off-by: Frank Audun Kvamtrø --- modules/mbedtls/Kconfig.psa | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/mbedtls/Kconfig.psa b/modules/mbedtls/Kconfig.psa index 70b6619a723..ff3c488e212 100644 --- a/modules/mbedtls/Kconfig.psa +++ b/modules/mbedtls/Kconfig.psa @@ -160,6 +160,7 @@ 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 From b55db60b325dfc8c51f947f72ffc1eae5b58151d Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 20 Sep 2024 14:48:37 +0200 Subject: [PATCH 821/825] [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 --- lib/os/zvfs/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/os/zvfs/Kconfig b/lib/os/zvfs/Kconfig index 7f50ff52bef..64808b7ce36 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 85f1ac90bff0a6ea309e8c6b6230bac77bccfe01 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 14:59:59 +0200 Subject: [PATCH 822/825] [nrf noup] manifest: update open-amp sha This should be removed once https://github.com/zephyrproject-rtos/open-amp/pull/21 is merged. Signed-off-by: Bjarki Arge Andreasen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 49bc40e1e4f..938784509c6 100644 --- a/west.yml +++ b/west.yml @@ -303,7 +303,7 @@ manifest: revision: d2a119a9c7600ce06033a794de042e0ad9a38702 path: modules/bsim_hw_models/nrf_hw_models - name: open-amp - revision: 76d2168bcdfcd23a9a7dce8c21f2083b90a1e60a + revision: pull/21/head path: modules/lib/open-amp - name: openthread revision: e10a92570f94ff1e0bc5e0da9ecf0ee135d955a6 From c2e391fa0c55e6fa44a96c152e2db6059efe3cb3 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Mon, 23 Sep 2024 15:04:23 +0200 Subject: [PATCH 823/825] [nrf fromlist] doc: extensions: link-roles: missing module not critical External projects building the documentation may not clone all modules, as they have manifest filtering. Therefore, not having access to a module should not produce a fatal documentation build error. Convert the error to a debug log, so it is at least traced. Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/78876 Signed-off-by: Gerard Marull-Paretas Signed-off-by: Bjarki Arge Andreasen --- doc/_extensions/zephyr/link-roles.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/_extensions/zephyr/link-roles.py b/doc/_extensions/zephyr/link-roles.py index 19d2a985487..c1474bab312 100644 --- a/doc/_extensions/zephyr/link-roles.py +++ b/doc/_extensions/zephyr/link-roles.py @@ -9,6 +9,7 @@ import re import subprocess from docutils import nodes +from sphinx.util import logging try: import west.manifest @@ -21,6 +22,9 @@ west_manifest = None +logger = logging.getLogger(__name__) + + def get_github_rev(): try: output = subprocess.check_output( @@ -88,9 +92,7 @@ def role(name, rawtext, text, lineno, inliner, options={}, content=[]): ) # Invalid module provided elif module != config.link_roles_manifest_project: - raise ModuleNotFoundError( - f"Module {module} not found in the west manifest\n\t{trace}" - ) + logger.debug(f"Module {module} not found in the west manifest") # Baseurl for manifest project not set elif baseurl is None: raise ValueError( From bbb3258f0a20a8c387b771aa07666f1cf518d434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Mon, 23 Sep 2024 16:02:50 +0200 Subject: [PATCH 824/825] [nrf noup] hostap: Support legacy dependency checkup for nrf_security MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Enabling MBEDTLS_ECP_DP_SECP256R1_ENABLED curve type to ensure we don't get error-warnings about MBEDTLS_ECP_C dependencies not being met for WIFI samples. Signed-off-by: Frank Audun Kvamtrø --- modules/hostap/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index f4c531e1d40..b329cd2e4f0 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -136,6 +136,7 @@ config WIFI_NM_WPA_SUPPLICANT_CRYPTO select MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED select MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED select MBEDTLS_KEY_EXCHANGE_ALL_ENABLED + select MBEDTLS_ECP_DP_SECP256R1_ENABLED config WIFI_NM_WPA_SUPPLICANT_CRYPTO_ALT bool "Crypto Mbedtls alt support for WiFi" @@ -162,6 +163,7 @@ config WIFI_NM_WPA_SUPPLICANT_CRYPTO_ALT select MBEDTLS_SERVER_NAME_INDICATION select MBEDTLS_X509_CRL_PARSE_C select MBEDTLS_TLS_VERSION_1_2 + select MBEDTLS_ECP_DP_SECP256R1_ENABLED config WIFI_NM_WPA_SUPPLICANT_CRYPTO_LEGACY_NCS bool "Legacy Crypto support for WiFi using nRF security" @@ -180,6 +182,7 @@ config WIFI_NM_WPA_SUPPLICANT_CRYPTO_LEGACY_NCS select MBEDTLS_CIPHER_PADDING_PKCS7 select MBEDTLS_PK_WRITE_C select MBEDTLS_KEY_EXCHANGE_ALL_ENABLED + select MBEDTLS_ECP_DP_SECP256R1_ENABLED config WIFI_NM_WPA_SUPPLICANT_CRYPTO_LEGACY_NCS_PSA bool "PSA Crypto support for WiFi using nRF security" @@ -206,6 +209,7 @@ config WIFI_NM_WPA_SUPPLICANT_CRYPTO_LEGACY_NCS_PSA select MBEDTLS_MD_C select MBEDTLS_CIPHER_PADDING_PKCS7 select MBEDTLS_PKCS5_C + select MBEDTLS_ECP_DP_SECP256R1_ENABLED config WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE bool "No Crypto support for WiFi" From 982e5612065b1d43fc0182802084a76f8c69b71f Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Tue, 24 Sep 2024 10:26:24 +0200 Subject: [PATCH 825/825] fixup! [nrf noup] tree-wide: support NCS Partition Manager (PM) definitions --- cmake/linker/ld/target.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/linker/ld/target.cmake b/cmake/linker/ld/target.cmake index 8c18fce0e9a..d45f35de238 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}